Assignment: #3 (Guessing Game Part 1) Solution

Assignment Objective:
----------------------
In this assignment, you will create an interactive number-guessing game. This
will be a 2-part assignment. In this part (due next week), you will demonstrate
your knowledge about the following concepts:
- Standard Input/Output (printf, scanf)
- Functions & Function Prototypes (declaring, defining and invoking)
- Conditional logic (if/else)
Next week, you will modify this program to add looping and file I/O logic.


Assignment Details:

- Create a program that generates a "random" letter, and gives the user
up to 6 chances to guess that letter.
- If the player guesses the right answer before they run out of chances,
the game is over and they are congratulated.
- If the player guesses wrong, your program will tell them whether their
answer is too high or if it is too low. Using a loop (i.e., WHILE),
the user gets to guess again, until they run out of chances.
- If the player guesses wrong on the 6th try, the game is over,
ad the player is consoled. The correct answer is displayed.
- Once the game is over, you should thank the user for playing, and exit.
- In your code, use braces and indentation appropriately.
- Name your variables with meaningful names whenever possible, instead of "x".
- Make sure that you include comments in your program to make it more readable.
Please include a series of comments at the top of your program identifying
this this course, your name and the assignment, as well as a short description
of what the program accomplishes. Also include comments that briefly describes
what the program is doing, along the way. They can be simple, but descriptive.

The idea is to make the flow of your program readable by humans, even if they
do not understand C.
NOTE: You do not need to comment every line of code. If you have doubled the
number of characters in yours assignment, you may have overdone it.
Think about how you would organize a term paper, and you have the
general idea.
Powered by