LetterGuessingGame_C

Download Category:

letterguessinggame_c.zip - (241.77 KB)
[
LetterGuessingGame_C/Debug/
LetterGuessingGame_C/Debug/cl.command.1.tlog
LetterGuessingGame_C/Debug/CL.read.1.tlog
LetterGuessingGame_C/Debug/CL.write.1.tlog
LetterGuessingGame_C/Debug/LetterGuessingGame_C.exe
LetterGuessingGame_C/Debug/LetterGuessingGame_C.exe.embed.manifest
LetterGuessingGame_C/Debug/LetterGuessingGame_C.exe.embed.manifest.res
LetterGuessingGame_C/Debug/LetterGuessingGame_C.exe.intermediate.manifest
LetterGuessingGame_C/Debug/LetterGuessingGame_C.ilk
LetterGuessingGame_C/Debug/LetterGuessingGame_C.lastbuildstate
LetterGuessingGame_C/Debug/LetterGuessingGame_C.log
LetterGuessingGame_C/Debug/LetterGuessingGame_C.obj
LetterGuessingGame_C/Debug/LetterGuessingGame_C.pdb
LetterGuessingGame_C/Debug/LetterGuessingGame_C.vcxprojResolveAssemblyReference.cache
LetterGuessingGame_C/Debug/LetterGuessingGame_C.write.1.tlog
LetterGuessingGame_C/Debug/LetterGuessingGame_C_manifest.rc
LetterGuessingGame_C/Debug/link.12816.read.1.tlog
LetterGuessingGame_C/Debug/link.12816.write.1.tlog
LetterGuessingGame_C/Debug/link.12816-cvtres.read.1.tlog
LetterGuessingGame_C/Debug/link.12816-cvtres.write.1.tlog
LetterGuessingGame_C/Debug/link.command.1.tlog
LetterGuessingGame_C/Debug/link.read.1.tlog
LetterGuessingGame_C/Debug/link.write.1.tlog
LetterGuessingGame_C/Debug/link-cvtres.read.1.tlog
LetterGuessingGame_C/Debug/link-cvtres.write.1.tlog
LetterGuessingGame_C/Debug/mt.command.1.tlog
LetterGuessingGame_C/Debug/mt.read.1.tlog
LetterGuessingGame_C/Debug/mt.write.1.tlog
LetterGuessingGame_C/Debug/rc.command.1.tlog
LetterGuessingGame_C/Debug/rc.read.1.tlog
LetterGuessingGame_C/Debug/rc.write.1.tlog
LetterGuessingGame_C/Debug/vc100.idb
LetterGuessingGame_C/Debug/vc100.pdb
LetterGuessingGame_C/LetterGuessingGame_C.cpp
LetterGuessingGame_C/LetterGuessingGame_C.sln
LetterGuessingGame_C/LetterGuessingGame_C.suo
LetterGuessingGame_C/LetterGuessingGame_C.vcxproj
LetterGuessingGame_C/LetterGuessingGame_C.vcxproj.filters
LetterGuessingGame_C/LetterGuessingGame_C.vcxproj.user
LetterGuessingGame_C/lettersin.txt
LetterGuessingGame_C/Question.txt
LetterGuessingGame_C/Screenshot_1.png
]

You will write a C program that will play a letter guessing game.
General Requirements
? Write a program that reads letters from a file called “lettersin.txt”.
? Your program will ask the user to enter the number of games they wish to play (1 to 4)
? Your program will open the lettersin.txt file read in one character at a time and repeat this for the
number of games the user wants to play.
? For this assignment the test file will contain letters, all lowercase
? When the number of games has been played, the program will end
? A sample of an input file that you can use to test your program is included with the assignment.
? A preprocessor directive must be used to define the maximum number of guesses as 5
? If the player has used up all of their guesses, a message that the game is over should be displayed
along with the letter they were trying to guess.
? You must have at least 4 user defined functions as follows:
//this function provides instructions to the user on how to play the game
void GameRules( );
//this function runs one entire game. It for checks either 5 incorrect guesses or a correct guess.
//It returns a 0 if the game is over and the player did not guess the letter, otherwise it returns 1.
int SingleGame(char file_letter);
//this function prompts the player to make a guess and returns that guess
//this function is called from inside the SingleGame( ) function described above
char RetrieveGuess( );
//this function takes two arguments, the guess from the player
//and the solution letter from the file.
//It lets the user know if the guess comes alphabetically before or after the answer
//The function returns 1 if the guess matches the solution and returns a 0 if they do not match
//this function is called from inside the OneGame( ) function described above
int GuessedIt(char answer, char input_letter);
Additional Requirements:
? Use function prototypes.
? Write comments for each function that will appear in the file before each prototype and
again before each function definition.
? Be sure to comment your code adequately.
? Be sure to indent properly. Check your textbook and lecture code examples to see how it should
be done.
? Use meaningful variable names
? Check all requirements list on Blackboard before submitting

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.