Question

Write a program that grades arithmetic quizzes as follows: 1. Ask the user how many questions are in the quiz. 2. Ask the user to enter the key (that is, the correct answers). There should be one answer for each question in the quiz, and each answer should be an integer. They can be entered on a single line, e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. You will need to store the key in an array. 3. Ask the user to enter the answers for the quiz to be graded. As for the key, these can be entered on a single line. Again there needs to be one for each question. Note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. When the user has entered all of the answers to be graded, print the number correct and the percent correct. When this works, add a loop so that the user can grade any number of quizzes with a single key. After the results have been printed for each quiz, ask "Grade another quiz? (y/n)."

          Write a program that grades arithmetic quizzes as follows:
1. Ask the user how many questions are in the quiz.
2. Ask the user to enter the key (that is, the correct answers). There should be one answer for each question in the quiz, and each answer should be an integer. They can be entered on a single line, e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. You will need to store the key in an array.
3. Ask the user to enter the answers for the quiz to be graded. As for the key, these can be entered on a single line. Again there needs to be one for each question. Note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered.
4. When the user has entered all of the answers to be graded, print the number correct and the percent correct.

When this works, add a loop so that the user can grade any number of quizzes with a single key. After the results have been printed for each quiz, ask "Grade another quiz? (y/n)."
        
Show more…

Added by Gwendolyn T.

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
Write a program that grades arithmetic quizzes as follows: 1. Ask the user how many questions are in the quiz. 2. Ask the user to enter the key (that is, the correct answers). There should be one answer for each question in the quiz, and each answer should be an integer. They can be entered on a single line, e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. You will need to store the key in an array. 3. Ask the user to enter the answers for the quiz to be graded. As for the key, these can be entered on a single line. Again there needs to be one for each question. Note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. When the user has entered all of the answers to be graded, print the number correct and the percent correct. When this works, add a loop so that the user can grade any number of quizzes with a single key. After the results have been printed for each quiz, ask "Grade another quiz? (y/n)."
Close icon
Play audio
Feedback
Powered by NumerAI
David Collins Ivan Kochetkov
Jennifer Stoner verified

Cora Marcet and 92 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
write-a-program-to-read-a-list-of-exam-scores-given-as-integer-percentages-in-the-range-o-to-100-display-the-total-number-of-grades-and-the-number-of-grades-in-each-letter-grade-category-as-12493

Write a program to read a list of exam scores given as integer percentages in the range 0 to 100. Display the total number of grades and the number of grades in each letter-grade category as follows: 90 to 100 is an A, 80 to 89 is a B, 70 to 79 is a C, 60 to 69 is a D, and 0 to 59 is an F. Use a negative score as a sentinel value to indicate the end of the input. (The negative value is used only to end the loop, so do not use it in the calculations.) For example, if the input is: 98 87 86 85 85 78 72 70 66 63 50 -1 The output would be: Total number of grades = 14 Number of A's = 1 Number of B's = 4 Number of C's = 6 Number of D's = 2 Number of F's = 1

Cora M.

you-are-tasked-with-creating-a-java-program-that-simulates-a-simple-quiz-game-the-program-should-prompt-the-user-with-a-series-of-questions-and-allow-them-to-enter-their-answers-after-the-user-has-a-2

You are tasked with creating a Java program that simulates a simple quiz game. The program should prompt the user with a series of questions and allow them to enter their answers. After the user has answered all the questions, the program should compute and display the final score based on the number of correct answers. For this assignment, write a Java program that implements the functionality described in the scenario. Ensure that your program is error-free, compiles successfully, and produces the expected output. Test your program with different inputs to verify its correctness. Make sure the following requirements are met: The program should include five multiple-choice questions with four options. The four options should be labeled A, B, C, and D. The program should prompt the user to enter their answer by typing the corresponding letter (A, B, C, or D). After the user has entered their answer for each question, the program should compare it to the correct answer and keep track of the number of correct responses. The program should compute and display the final score as a percentage of the total number of questions. Use if and switch case statements to handle user input and compare it to the correct answers. Include comments to explain the purpose of each section of code and enhance code readability.

Akash M.

write-program-called-gradesaverage-which-prompts-user-for-the-number-of-students-reads-it-from-the-keyboard-and-saves-it-in-an-int-variable-called-numstudents-it-then-prompts-user-for-the-gr-26845

Write a program called GradesAverage, which prompts the user for the number of students, reads it from the keyboard, and saves it in an int variable called numStudents. It then prompts the user for the grades of each of the students and saves them in an int array called grades. Your program shall check that the grade is between 0 and 100. A sample session is as follows: Enter the number of students: Enter the grade for student 1: 55 Enter the grade for student 2: 108 Invalid grade - try again. Enter the grade for student 2: 56 The average is 56.

Florencia C.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,499 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,155 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,628 solutions

*

Transcript

-
00:01 In this problem, we're asked to read a bunch of exam scores, a bunch of numerical exam scores, and then from there calculate how many fs, d, cs, bs, and a's we have, and then at the end to return that information to the user.
00:19 So to begin, i've created a new scanner variable.
00:23 I've just called it in, and this is because we're going to be getting user inputs.
00:28 We need a scanner variable.
00:30 Then i also initialized the variable score.
00:34 It's an int.
00:34 I just said equal to zero.
00:36 This variable we're going to be changing every time the user enters a new score, it's kind of like a temporary variable in that sense.
00:46 And then i also initialized f, d, c, b, and a integer variables because we're going to be calculating how many of each of these letter grades that we are receiving.
01:02 So in this while loop here is where we get all the user input, and we continue looping through as long as score is greater than or equal to zero.
01:13 Why are we doing this? well, in the problem, it states that if the user enters a negative value for score, then that signifies or should signify to the program that the loop ends.
01:24 Therefore, that's why we have this conditional here.
01:28 We keep going through the while loop as long as they haven't entered that negative value or scores greater than equal to zero.
01:36 So we prompt the user to go ahead and enter a score...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Join the community

18,000,000+

Students on Numerade


Trusted by students at 8,000+ universities

Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever