Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

COP 2220- Intro to C- Hangman Game Program I am having a bit of trouble with thi

ID: 3705596 • Letter: C

Question

COP 2220- Intro to C- Hangman Game Program

I am having a bit of trouble with this program. Can somebody help me with this? It has to be in C.

****Please do only one step at a time and do not move onto the next step until you have compiled and tested the current step Create a project and name the source code hangman.c Add the function prototype and implement the function definition for the Hangman instructions function Add the function call in the main function 1. 2. 3. * build run and test 4. Create and implement the (y or n) loop in the main function, I suggest using a do/while loop 5. Add the function prototype and implement the function definition for the function that determines if the player wants to play another round 6. Add the function call build run and test 7. Go to the assignment and save "words.txt" into the same directory as hangman.c (remember to use your Z drive on portal.eng.fau.edu) 8. Declare a file pointer variable, connect to the input file and use fscanf to read a word from the file 9. Remember to add the space in fscanf for %s 10. Use printf statements to see the word from the file print onto the screen (inside the loop) build run and test - Each time you enter y a new word will be read from the file and printed on the screen GET HELP HERE IF YOU CANNOT CONNECT, READ AND PRINT THE WORDS FROM THE FILE) 11. Add the function prototype and implement the function definition for the function that changes a character array to all one case (upper or lower) Use the toupper or tolower function (from ctype.h) to change each letter in the word to upper or lowercase (Hint: you need to loop thru the array character by character) a. word[i]toupper(word[i]); //example build run and test (use printf to test) 12. Now it is time to create the Play One Round function and pass the solution word to this function, make the function prototype, prepare the definition and call the function from inside the do/while loop in main 13. Declare 2 character arrays inside the Play One Round of the game function (starword, lettersGuessed) initialize lettersGuessed to the empty string ("") 14. Add the function prototype and implement the function definition for the create starword function, pass the empty star word and the number of letters in the solution word to this function, you need to use a loop to assign *' to each character in the array, do not forget to add the '"10' null character build run and test 15. There will be a loop inside the Play one round function that will continue until the user has used up 6 (MAXGUESSES) or guesses correctly An entire round of the game

Explanation / Answer

As i can see here you have requested around 10 question to answers. I am going to reply you few initials later on you can ask the remaining.

You first question to change the toupper or tolower, all the characters in a given array.

funtion prototype:
void change_to_case(bool case, char arr[]);


here the case variable been taken to decide whether requested to change in upper case or lower case.
now array will have the char type values.

Definitions:

void change_to_case(bool case, char arr[])
{
int arr_length = sizeof (a)/ sizeof (a[0]);

for (int loop =0;loop< arr_length;loop++)

{
if (case == 0) //to lower case
{
arr[loop] = tolower(arr[loop]);

}

else

{

arr[loop] = toupper(arr[loop]);   
}

}

}

kinldy let me know if you need the reply of any specific question.

this function definition and prototype you can copy to a main file.

there you can do :

#inlcude <ctypes.h>

even you can write the definition of toupper and tolower. just by doing 5 times right and left shifting f nitwise.

>> << .

Thanks.