Write a simple Mathematics quiz application which has six selections as below:
1) To register number of participants and name
2) To set level of difficulty (level: Beginner or Advanced)
3) To start the quiz (default: Beginner level)
4) To display the scores
5) To show ranking
6) To quit
Your program has to ask the user to key in the following details:
i) An integer (from 1 to 6) representing the program menu selection options.
ii) An integer (from 1 to 5) representing number of participants (maximum 5 participants).
iii) A character representing the level of difficulty: ‘B’ for Beginner; ‘A’ for Advanced.
a. Beginner level: Participants are required to answer as many questions as possible in 60 seconds. Questions involving addition, subtraction or multiplication operation are chosen randomly. The two operands in this level have to be set within 1 to 50 inclusive.
b. Advanced level: Participants are required to answer as many questions as possible in 60 seconds. Questions involving square or square root operation are chosen randomly. The operand for questions involving square ranges from 1 to 30 inclusive. The operand for questions involving square root ranges from 1 to 900 inclusive and must be a perfect square number.
iv) A character (any key) to start the quiz
v) A string representing the response to the quiz question.
User can either key in the answer for the question or key in ‘n’ to skip the question. If an invalid response is detected, user will be asked to re-enter the string until it is valid. The answer for the question will then be converted from string to integer so that it can be compared with the actual answer. Each correct answer gives the participant 4 marks. 2 marks will be deducted for each wrong answer. 1 mark will be deducted for each skipped question.
The scores analysis for the participants will then be tabulated and the participants will be ranked from the highest score to the lowest score.
• Loop your program so that the user will be asked to choose from the selection menu above after completing each selection task. Stop the loop only when the user select option 6 to quit.
• When the user quits the loop, display “Bye!”
• Your program must contain at least 8 functions excluding the main function.
• Do not use any global variables.
• Include as well necessary input validations/ error checking in the program.
so basically this is the question. Im taking this step by step and had did a switch loop for the menu choices but the problem is i dont know how to loop it so the user will be asked to choose from the selection menu above after completing each selection task.
btw, a simple guide on how to continue would be a great help. I will show my work after i get the general idea of how the whole program should be written.
Thanks in advance for the help.