Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that grades arithmetic quizzes as follows: 1. Ask the user how m

ID: 3613372 • Letter: W

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 eachanswer 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 a10-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. Asfor the key, these can be entered on a single line. Again thereneeds to be one for each question. Note that these answers do notneed to be stored; each answer can simply be compared to the key asit is entered.

4. When the user has entered all of the answers to be graded, printthe number correct and the percent correct.

****When this works, add a loop so that the user can grade anynumber of quizzes with a single key. After the results have beenprinted for each quiz, ask "Grade another quiz? (y/n)."
--------------------

I am not sure what do due for the last part, adding a loop so theuser can grade any number of quizzes with a single key and afterthe results have been printed for each quiz, ask .....

this is what i have so far, i think i got 1-4 done, last parti am stuck

   public class Quiz
{

   public static void main(String[] args)
   {
       int num_quiz; //number on thequiz
       int to_grade;
       int count = 0;
       double total;
      
       int total_quizzes; //total #of quizzes to be graded
      
       Scanner scan = new Scanner(System.in);
      
          System.out.print ("How many questions are in the quiz? ");
           num_quiz =scan.nextInt();
      
      
       int [] answers = new int[num_quiz];
      
        System.out.println("Enter theanswer keys for the questions.");
     
          
        for (int i=0; i<answers.length; i++)
{
  
       answers[i] =scan.nextInt();
}
  
   System.out.print("How many quizzes do you wantto grade? ");
  
  
       total_quizzes =scan.nextInt();
       
  
       for (int i =0; i <answers.length; i++)
       {
          
           System.out.println("Enter the answer to be graded : ");
              to_grade = scan.nextInt();
             
              if(to_grade == answers[i]){   
                  ++count;
             
                  }
      
             
       }
      
       total = (double)count /num_quiz *100;
      
       System.out.println("Thenumber of questions correct are: " + count);
       System.out.println("Thepercentage correct is: " +total);
       System.out.println("Gradeanother Quiz? y/n");
      
  
   }  
}      
      
  
  
   



Explanation / Answer

please rate - thanks I tried to clean the form a little, and don't need to ask how manyquizzes or the variable total_Quizzes import java.util.*;    public class Quiz {     public static void main(String[] args)     {         int num_quiz; //numberon the quiz         int to_grade;         int count = 0;         double total;           char yesorno='y';         Scanner scan = newScanner (System.in);         System.out.print ("Howmany questions are in the quiz? ");         num_quiz =scan.nextInt();             int [] answers = new int[num_quiz];               System.out.println("Enter the answer keys for the questions.");                           for (int i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote