I need to write this quiz using functions. I'm only looking for directions, advice, etc.
Do I have to write a function for each question or can do one to cover them all?
How I store the input so I can display the correct/incorrect answers at the end? Would it be scanf()?
1) Create a quiz that contains at least five questions about a hobby, popular music, astronomy, or any other personal interest.
2) Each question can be multiple choice or true/false answers
a) valid responses are a, b, c, or d
b) t or f
3) Data validation (hint: may need to use the phantom newline character solution from your book.)
a) If the user responds to a question with an invalid character, display an error message and prompt the user again.
b) If the user answers the question with a valid and correct response, display an appropriate message to reflect this.
c) If the user responds to a question with a valid but incorrect response, display an appropriate message as well as the correct answer.
4) At the end of the quiz, display the number of correct and incorrect answers.
Option 2: Guess the Number
1) Generate a random number from 1 through 100 and allow the user to guess the number.
2) After each guess, display a message that informs the user if the guess was
a) too high,
b) too low, or
3) Allow the user to play until the number is guessed correctly
4) When the number is guessed correctly, display a count for the number of guesses that were needed. (hint: use the rand() or srand() function for the random number generator).
Option 3: Quit
1) Exit program.
I feel like I jumped in a lake wearing concrete shoes. :/