Question: In python Purposes: For this assignment, you need to implement an improved version of the math quiz tool for Ist graders. The program will generate

In python  In python Purposes: For this assignment, you need to implement an
improved version of the math quiz tool for Ist graders. The program
will generate five random addition or subtraction questions and provide feedback to

Purposes: For this assignment, you need to implement an improved version of the math quiz tool for Ist graders. The program will generate five random addition or subtraction questions and provide feedback to students. You will practice the following things through this exercise - Using if statements with appropriate conditional expression - Using while-loop with appropriate loop-continuation-condition - Practicing string output formation Description: - The program will generate five random questions. - For each question: Randomly decide whether the question is for addition or subtraction Display the question on the screen Ask the students to enter the answer Give feedback to students (correct or incorrect) - After a student answers all five, report the number of correct answers, calculate and report a letter grade, and display all the questions. Each addition question is worth 5 points, and each subtraction question is worth 10 points Letter grade conversion: A-90\% of total points, B-80\%, C-70\%, D-60\%, E50\% and below - Your program should act similarly to the figure below. - A starter code with the basic structure of the program is also provided. Submission: - Take a screenshot of your Command-Line Window output. If necessary, you may take multiple screenshots. - Submit your Python seript (i.e, the , py file) and screenshot(s) in Blackboard. Criteria: - Name of the file 5 points - Header comments 5 points - Comments in code 10 points - The screenshot 10 points - The program and cutputs 70 points import randon def main() : totalQuestion =5 \# total nunber of questions questionCount =0 = how many questions have been generated corretCount =0 a how nany questions are answered correctly allQuestions = =u = a string used to track all the questions and correctness earnedpoints =0 \# how eany points have been earned countsubtraction =0 \# you may need to count how nany subtraction and addition questions have been generated in total. - This infornation wilt be useful when converting the earned points to a tetter grade. Use a white-toop to generate 5 randon questsions. For each-iteration of the while-loap; Generate two randon numbers between a and 9 becide whether this question is an addition question or a subtraction question If it is a subtraction question, aake sure the ist nuaber is greater than the 2nd one increase the count of subtraction questians 5tore the question into a string variable (e.g.. currentouestion) Store the correct answer of this question into a variabte (e.g., correctAnswer) Add this question to the output string ( i.e.. atlQuestions = altevections + currentQuestion) Ask the user to enter an answer and store the value into anether variable (e.g.r userAnswer) If (useranswer mi correctanser) Display "Great jobi" Add "correct" to the output string (1.e.., atiquestions = attQuestions + "lterrectin") Increase the count of correct answered question by 1 Increase the earned points If the question is a subtraction, countsubtraction = countsubtraction - 10 Flse, countsubtraction = countsubtraction + 5 Etse Display "Wrong answer..." Hdd "incorrect" to the output string (1.t.. atiouestions = atlouestions + "itincorrectin") Increase the total number of generated questions by 1 . After the 100p, the program need to: Calcutate the letter grade. To do this, the pregras needs to get the perfect points for these five questions first. Because the questions are random generated, and addition questions and subtraction vestions have different points. So, thece is not a fixed number for the perfect points. The perfect poists witt between 25 and 5e points. If all the questions are additions, the perfect. points is "5 points + 5 question =25. It all the evestions are subtractions, the perfect points is " 10 points * 5 questien = 50. Hewevef, nore than Iikely, the student with have-nixed of addition ad subtraction questions. Then, the perfect points vitt bet - nuber_of subtraction * 10 + number_of_addition * 5". After getting the muber of the pertect points, the progran needs te-covert the wser earnespoints to percentage. You aight med to convert. the aivision result to a fleating peint nuaber, Then. the progran nay copvert the percentage grade to letter grase wising the gives rutes. Display the following things: 1) The number of corrected questions, 2) The letter grade. 31att the queitions the carcesaanding correctnes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!