3 Doors (20 points) Consider the following game: There are 100 doors (numberd1 t
ID: 3728514 • Letter: 3
Question
3 Doors (20 points) Consider the following game: There are 100 doors (numberd1 through 100) and 100 students labeled with ids from 1 to 100 waiting in a line. Initially, all the doors are closed. A student with doors that are multiples of r (i.e., student with id r goes to doors labeled with ,2r,3r,. ) and changes the status of each door, i.e., opens the door if it is closed or closes the door if it is open. After all the students compl their turns, which doors remain open? Write a C program that mimics this experiment and prints the labels of doors that remain open after all students in line have passed through the doors. Moreover, it prints the number of doors that remained open and id z passes through all the For this problem, submit your pseudocode 4 Hangman (20 points) Write an interactive program that plays a game of hangman. Store the characters of the word to be guessed in an array of type char (you can initialize your character array at declaration). Words are seven letters long. Initially the program displays the length of the word to be guessed. This is in the form of successive stars (see example). The player guesses letters belonging to the secret word one by one. After each guess, the letters that have been guessed and the number of wrong guesses are displayed on screen. Your program should terminate when either the entire word is guessed or 4 incorrect guesses have been attempted. Your program must be modular. Create at least two meaningful functions that abstract details such as printing the word state after a letter guess is attempted or searching for a letter within a word. Test your program for the words: abandon, annoyed, finance, acrobic, inferno, infancy Sample execution for word abandon: i, let's play hangman. The secret vord is: Guess a letter:t Letter t is not part of the secret vord, You have 3 attempts left Guess a letter:a Letter a exists 2 times in the secret vord, You have 3 attempts left Guess a letter:e Letter e is not part of the secret word, you have 2 attempts left For this problem, submit your pseudocode Submit your .c files named hw6-pl.c, hw6-p2.c, hw6.p3.c, and hw6.p3.c via D2L dropboxExplanation / Answer
}
2.)
count++;
else
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.