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
Lostsunrise [7]
2 years ago
7

Write a C++ program to grade the answers to a true-false quiz given to students in a course. The quiz consists of 5 true-false q

uestions. Each correct answer is worth 2 points.
Computers and Technology
1 answer:
Eddi Din [679]2 years ago
7 0

The quiz program is an illustration of loops and conditional statements

  • Loops are used to perform repetition
  • Conditional statements are used to make decisions

<h3>The quiz program</h3>

The quiz program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

int main(){

   //This prints the instruction

   cout<<"Enter T/t for True; F/f for False\n";

   //This initializes the question

   string questions[5] = { "Q1", "Q2", "Q3", "Q4", "Q5"};

   //This initializes the correct options

   char options[5] = { 'T','T','F','F','T'};

   //This declares the user response

   char opt;

   //This initializes the score to 0

   int score = 0;

   //This loop is repeated 5 times

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

       //This prints the current question

       cout << i + 1 <<". "<<questions[i]<<"\nAnswer: ";

       //This gets the user response

       cin>>opt;

       //If the user response is correct

       if(toupper(opt) == options[i]){

           //The score is incremented by 2

           score+=2;

       }

   }

   //This prints the total score

   cout<<"Score: "<<score;

   return 0;

}

Read more about loops at:

brainly.com/question/19347842

You might be interested in
Where is the bios in the soft ware or hard ware
Mandarinka [93]

Answer:

The BIOS is special software that interfaces the major hardware components of your computer with the operating system. It is usually stored on a Flash memory chip on the motherboard, but sometimes the chip is another type of ROM.

So software

Hope that helps!!!

6 0
4 years ago
Read 2 more answers
WILL MARK BRAINLIEST IF ANSWERED ASAP
Sveta_85 [38]

True so that you will have the knowledge about the setting and so will be able to decide the best places to shoot your photograph. Hope that this helped you hon :)

7 0
3 years ago
Which of the following occupations is the most likely o require working weekends and night shifts
Juliette [100K]
What are the choices?
5 0
3 years ago
Read 2 more answers
Who are the people responsible for maintaining and controlling computer networks within an organization?
erik [133]

Answer:

Network Administrators

Explanation:

Network and computer systems administrators are responsible for the day-to-day operation of these networks. They organize, install, and support an organization's computer systems, including local area networks (LANs), wide area networks (WANs), network segments, intranets, and other data communication systems.

6 0
3 years ago
Mikaya works in the planning department
Sonja [21]

Answer:

I don't understand need more information mate.

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Privacy concerns, financial information, security of your personal data has
    14·1 answer
  • Write a Java program that generates a random number between 0 and 50. Then, the program prompts for guesses until the user is co
    14·1 answer
  • The top pane of the wireshark window, referred to as the __________, contains all of the packets that wireshark has captured, in
    5·1 answer
  • The ____________ deals with the well-being of the EMT, career progression, and EMT compensation. Select one: A. EMS administrato
    9·1 answer
  • Refer to the exhibit. One end of the cable is terminated as displayed, and the other end is terminated in accordance with the T5
    7·1 answer
  • Which of these consoles had a 64-bit architecture
    10·1 answer
  • When did computer networking go beyond the walls of the firm?
    15·1 answer
  • Create a python code with 5 circles, 5 polygons, 5 line commands, 2 for loops, and 1 global variable
    12·1 answer
  • _ is a term used for license like those issues by creative commons license as an alternative to copyright
    8·1 answer
  • The largest amount of data, in bytes, which can be accomodated by a particilar network, link, or physical-layer is called the?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!