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
defon
1 year ago
15

The local Driver's License Office has asked you to write

Computers and Technology
1 answer:
Y_Kistochka [10]1 year ago
6 0

One of the most popular object-oriented programming languages is C++. Stroustrup created C++ by adding object-oriented features to the C programming language.

<h3>How do you write a program in C++?</h3>
  • Some people believe that the open-source C++ IDE Dev C++ is one of the finest. However, it may be used exclusively on Windows and macOS. It contains capabilities like profiling, integrated debugging, syntax highlighting, code completion, tool managers, and GCC-based compilers.
  • Many people believe that C++, an object-oriented programming (OOP) language, is the finest language for developing complex applications. The C language is a superset of C++.

#include <iostream>

#include <string>

#include <iomanip>

#include <cctype>

using namespace std;

class TestGrader

{

private:

string answer[20];

public:

void setKey(string[]);

void grade(string[]);

};

/*********************************************************************/

void TestGrader::setKey(string correct[])

{

for (int x = 0; x < 20; x++)

{

 answer[x] = correct[x];

}

}

void TestGrader::grade(string test[])

{

int right = 0;

int wrong = 0;

int count = 0;

for (int x = 0; x < 20; x++)

{

 if (test[x] == answer[x])

 {

  right += 1;

  count += 1;

 }

 else if (test[x] != answer[x])

 {

  wrong += 1;

 }

}

if (count >= 15)

{

 cout << "Congratulations you have passed the driver's license exam" << endl;

}

else

{

 cout << "You failed the driver's license exam" << endl;

}

cout << "You got a total of " << right << " right answers and a total of " << wrong << " wrong answers in the test" << endl;

cout << "You got questions ";

for (int x = 0; x < 20; x++)

{

 if (test[x] != answer[x])

 {

  cout << x + 1 << " ";

 }

}

cout << "wrong" << endl;

}

int main()

{

string answers[20] = { "B", "D", "A", "A", "C", "A", "B", "A", "C", "D", "B", "C", "D", "A", "D", "C", "C", "B", "D", "A"};

TestGrader exam;

exam.setKey(answers);

string yourTest[20];

int choice;

do

{

 for (int x = 0; x < 20; x++)

 {

  cout << "Enter the answer for question " << x + 1 << ": ";

  cin >> yourTest[x];

  while (yourTest[x] > "D"  || yourTest[x] < "A")

  {

   cout << "Please enter from A-D: ";

   cin >> yourTest[x];

  }

 }

 exam.grade(yourTest);

 cout << endl << "Enter -1 to quit, else enter any number to retake the exam: ";

 cin >> choice;

} while (choice != -1);

return 0;

}

To learn more about C++ refer,

brainly.com/question/15411348

#SPJ4

You might be interested in
___________ is an approach to boundary spanning that results from using sophisticated software to search through large amounts o
snow_tiger [21]

Answer: Business intelligence

Explanation:

Most of the enterprises and organizations collects huge amount of data through the use of MIS. These data can be based on any aspect of the business. But the collection of such large sets of data is useless until and unless there is a business intelligence associated with it. the work of business intelligence is to use software tools for analysis of the collected data so that it could be useful for enterprise or company to look for patterns and trends in the market.

The outcome of such business intelligence is very helpful particularly to managers, executives for taking particular decisions in the greater interest of the company.

So we can say, business intelligence is an approach to boundary spanning that results from using sophisticated software to search through large amounts of internal and external data to spot patterns, trends, and relationships that might be significant.

4 0
3 years ago
Hurry asap it’s times
Eddi Din [679]

Answer:

C and B.

Explanation:

6 0
3 years ago
What is the name of a button on a website?
zhuklara [117]
May I know which button?
5 0
3 years ago
which of the following are used on cable trays to protect the cable insulation from direct sunlight? a. barrier strips b. solid
laila [671]
The answer is barrier strips
7 0
3 years ago
Convert the following decimal number into octal number-147​
agasfer [191]

Answer:

The answer for your question is 223

3 0
3 years ago
Other questions:
  • How do i fix my this??
    12·2 answers
  • Dfd symbols are referenced by using all ____ letters for the symbol name.
    9·1 answer
  • Risa has a negative credit rating, and she feels obtaining a fresh loan credit is going to be quite difficult for her. Her frien
    15·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • The benefits of flextime include:
    11·2 answers
  • John was carrying on at the water cooler the other day, trying to show off his knowledge of networking. He claimed that the comp
    10·1 answer
  • Why is fluency in information technology becoming increasingly important for many college majors?
    6·1 answer
  • Which of the following describes a characteristic of organic light-emitting diodes (OLEDs) used in clothing?
    6·2 answers
  • What is the output for the following program?
    6·2 answers
  • someone please do this for and send a screeshot or picture please its really important for my examsss :D​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!