Write a program with at least TEN (10) functions inclusive of main function. The program
is able to generate two random numbers by using rand() function. The program is also
able to add the two numbers and also compare the result with the input from user. User is
given the option to continue or to stop the program. At the end, program is able to display
the number and percentage of correct and wrong answer. The program is also able to
determine the grade based on the percentage. If 80 – 100 (EXCELLENT), 60 – 79.99
(GOOD), 40 – 59.99 (INTERMEDIATE) and 0 – 39.99 (NEED IMPROVEMENT). You
are able to choose between do .. while or while loop.
Please fill in your answer for the addition of two numbers below:
1 + 7 = 8 (number (8) is key in by user)
1 + 7 = 8 (correct)
Do you want to continue next question (Y/N): Y
4 + 1 = 5 (number 5 is key in by user)
4 + 1 = 5 (correct)
Do you want to continue next question (Y/N): Y
9 + 4 = 12 (number 12 is key in by user)
9 + 4 = 12 (wrong)
Do you want to continue next question (Y/N): Y
8 + 8 = 16 (number 16 is key in by user)
8 + 8 = 16 (correct)
Do you want to continue next question (Y/N): N
You able to answer 3 correct question and 1 wrong question out of 4
question.
Percentage of marks is: 75.00 % - GOOD
Do you want to continue next SET OF QUESTION (Y/N): Y
Please fill in your answer for the addition of two numbers below:
1 + 7 = 8 (number (8) is key in by user)
1 + 7 = 8 (correct)
Do you want to continue next question (Y/N): N
You able to answer 1 correct question and 0 wrong question out of 1
question.
Percentage of marks is: 100.00 % (EXCELLENT)
Do you want to continue next SET OF QUESTION (Y/N): N
Terima kasih atas KEGIGIHAN ANDA !!!

Q&A Education