1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sdas [7]
4 years ago
10

1. Write a program that grades arithmetic quizzes as follows: (4 points) a. Assume there are 23 questions in the quiz. b. Ask th

e user to enter the key (i.e., the correct answers). There should be one answer for each question, and each answer should be an integer. The numbers are entered on a single line, e.g., 34 7 13 100 81 3 9 10 321 12 34 7 13 100 81 3 9 10 321 12 9 10 321. c. Ask the user to enter the answers for the quiz to be graded. Store the answers in an array. d. Print the number correct and the percent correct. e. Put the whole program in a do-while loop.
Computers and Technology
1 answer:
const2013 [10]4 years ago
5 0

Answer:

import java.util.Scanner;

public class Grade

{

public static void main(String[] args) {

   

    final int LENGTH = 23;

    int keys[] = new int[LENGTH];

    int responses[] = new int[LENGTH];

    int i = 1, correctCount = 0;

   

    Scanner input = new Scanner(System.in);

    do {

       

        System.out.print("Enter the key for answer " + i + ": ");  

        int key = input.nextInt();    

        keys[i-1] = key;

       

        System.out.print("Enter your response to question " + i + ": ");  

        int response = input.nextInt();    

        responses[i-1] = response;

       

        if (keys[i-1] == responses[i-1]) {

            correctCount ++;  

        }

        i++;

    }

   

    while(i <= LENGTH);

   

    double percentage = (double)correctCount / LENGTH;

   

 System.out.println("Number of the correct answers: " + correctCount);

 System.out.println("Percentage of the correct answers: " + percentage);

}

}

Explanation:

- Initialize the variables

Inside the do-while loop :

- Ask for the answer key and put the values in keys array

- Ask for the responses and put the values in responses array

- If values at the same position in both arrays are equal, increase the correctCount, that means the response is correct

- Print the correcCount and percentage

You might be interested in
Need help with these
kolbaska11 [484]
The first one is d the second one is true the third one is false
3 0
3 years ago
What's the biggest security issue with using social networking sites to market your listings?
Savatey [412]

The biggest security issue with using social networking sites to market your listings is Criminals may use social networking sites to identify your personal data.

<h3>What is a social marketing site?</h3>

A social marketing site is a site where people from around the world are connected in one place and share their thoughts and photos and other data.

The social sites are on the internet and there is a chance of stealing data and it identity theft, phishing, online predators, internet fraud, and other cybercriminal attacks are also some risks.

Thus, the largest security concern with using social networking sites to sell your listings is that thieves could use these sites to find personal information about you.

To learn more about social marketing sites, refer to the link:

brainly.com/question/15051868

#SPJ4

6 0
1 year ago
One or more access points positioned on a ceiling, wall, or other strategic spot in a public place to provide maximum wireless c
Lera25 [3.4K]

Answer:

hotspots.

Explanation:

Hotspots is a small geographical location with at least one access point in an outdoor/indoor setting, that provide people with maximum wireless coverage within that area and its mostly uses a wireless local-area network (WLAN) using a router to connect to an Internet service provider.

7 0
3 years ago
These are statements given by witnesses under oath? A. Testimony B. Admissible Evidence C. Indirect Evidence D. Circumstantial E
Aneli [31]

Answer:A. Testimony

Explanation:when someone knows something about what happened in the case held in court or they had witnessed what happened; In order to actual testify on what they know they are called on the stand and they have to raise their hand as a sign to swear an oath before the can give their testimony in court.

8 0
3 years ago
Which step creates a connection between a file and a program in python?
Mandarinka [93]
<span>The step of opening a file creates a connection between a file and a program.Opening an output file usually creates the file on the disk and allows the program to write data to it.Opening an input file allows the program to read data from the file.</span>
5 0
4 years ago
Other questions:
  • You just turned on a four port Ethernet switch (it hasn’t learned any addresses yet) and connected a host to each port. You send
    8·1 answer
  • Why don't we get together to watch the Academy Awards?
    15·2 answers
  • While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The changes
    7·1 answer
  • The technical relationship between inputs and outputs, which is needed to understand the difference between the short run and th
    5·1 answer
  • Define the acronym WAECUP and its components
    15·1 answer
  • Mica's creating his web page with a software that is free of charge for the first month. If he likes the program, he will have t
    7·2 answers
  • "As a ____ database management system, Access is particularly powerful because you can enter data once and then retrieve informa
    6·1 answer
  • Hardware is found outside the system unit.​
    13·1 answer
  • The PowerPoint view in which you can edit the slide master is called ______________.
    7·1 answer
  • Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!