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
Maslowich
3 years ago
12

Write a program that grades arithmetic quizzes as follows: Ask the user how many questions are in the quiz. Ask the user to ente

r 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. 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. When the user has entered all of the answers to be graded, print the number correct and the percent correct.
Computers and Technology
1 answer:
kirill115 [55]3 years ago
7 0

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int questions, answer;

   cout<<"Questions: ";

   cin>>questions;

   int answerkey[questions];

   cout<<"Enter answer keys: ";

   for(int i = 0; i< questions; i++){

       cin>>answerkey[i];    }

   int correct = 0;

   cout<<"Enter answers: ";

   for(int i = 0; i< questions; i++){

       cin>>answer;

       if(answer == answerkey[i]){

           correct++;        }    }

   cout<<"Correct answers: "<<correct<<endl;

   cout<<"Percentage correct : "<<(100 * correct)/questions<<"%";

   return 0;

}

Explanation:

This declares the number of questions and the answers submitted to each equation

   int questions, answer;

Prompt to get the number of questions

   cout<<"Questions: ";

This gets input for the number of questions

   cin>>questions;

This declares the answerkey as an array

   int answerkey[questions];

Prompt to get the answer key

   cout<<"Enter answer keys: ";

This iteration gets the answer key for each question

<em>    for(int i = 0; i< questions; i++){</em>

<em>        cin>>answerkey[i];    }</em>

This initializes the number of correct answers to 0

   int correct = 0;

Prompt to get the enter the answers

   cout<<"Enter answers: ";

This iterates through the answer keys

   for(int i = 0; i< questions; i++){

This gets the answer to each question

       cin>>answer;

This compares the answer to the answer key of the question

       if(answer == answerkey[i]){

If they are the same, correct is incremented by 1

           correct++;        }    }

Print the number of correct answers

   cout<<"Correct answers: "<<correct<<endl;

Print the percentage of correct answers

   cout<<"Percentage correct : "<<(100 * correct)/questions<<"%";

You might be interested in
Question 2 of 10
horrorfan [7]

Answer:

Lowest Level; Machine Language.

Explanation:

The lowest level of a computer is machine language, which are strings of 0's and 1's in bits, and it's possible to perform tasks at this level. It's however difficult to do and humans created <em>Assembly</em>; a type of low level programming language to be readable, and converts to machine language so that we don't have to work in binary.

4 0
2 years ago
True or False. A Windows Server 2016 that was installed in Desktop Experience mode can be converted to Server Core mode.
9966 [12]

When we install the Windows Server 2016 in Desktop Experience mode we cannot change it to Server Core mode. To change it we must uninstall it and reinstall it changing the mode (False).

<h3>What is Windows Server?</h3>

Windows Server is the name of a line of products created and marketed by the Microsoft Corporation software company.

One of its products is Windows Server 2016, this server was characterized by having two modes that were:

  • Desktop Experience
  • Server Core

However, it had the difficulty that the user could not switch between the two modes but had to uninstall and install the mode he wanted to use.

Learn more about Windows Server in: brainly.com/question/9426216

8 0
2 years ago
1.1 Why is primary goal of software development now shifting from
lidiya [134]

is where the term ‘App’ comes from. It is any piece of software that allows us to actually ‘use’ the computer. For example, it may be a word processor, web browser, spreadsheet software or even just a game. Application software relates to the user rather than the hardware

5 0
3 years ago
Which query will give the following result when it it applied on table 1????!!!!!
Mandarinka [93]

Answer:

B

Explanation:

You need Name , Age and Gender

the second requirement should only match the last row where age is 20 and gender is male.

thrid requirement of the query is that its syntax should be correct.

Option B staisfies all of required so it is the correct option.

6 0
3 years ago
RAM
Alex Ar [27]

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct answer is RAM.

RAM is used for storing programs and data currently being processed by the CPU.  So, the data in the RAM, can be easily accessible and processed by the CPU more fastly.

While Mass memory and neo volatile memory is not correct options. because these types of memory can stores a large amount of data but CPU fetch data from these memories into RAM. and, RAM can only be used by the CPU when performing operations.

7 0
3 years ago
Other questions:
  • While inserting images, the Picture command is usually used to insert photos from a digital camera, and the Clip Art command is
    7·1 answer
  • SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
    14·1 answer
  • What emphasizes extensive user involvement in the rapid and evolutionary construction of working prototypes of a system to accel
    15·1 answer
  • For this assignment, select one of the organizations with a prominent IT department from the Topic 1 assignment. Once identified
    11·1 answer
  • Research and build a chroot jail that isolates ssh users who belong to the restrictssh group. (You will also need to create the
    9·1 answer
  • Explain the following terms <br><br>copyleft:<br><br>creative Commons:<br><br>GNU/GPL:​
    8·1 answer
  • Wyatt has a database to keep track of his enormous collection of videos. How can Wyatt find the details for the game Lost on Mar
    11·2 answers
  • Page Setup options are important for printing a PowerPoint presentation a certain way. The button for the Page Setup dialog box
    15·1 answer
  • A. Why are the data known as raw facts? Explain.​
    14·2 answers
  • Which source would provide the best way to find valid information about climate change
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!