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
sertanlavr [38]
3 years ago
6

LAB 3.3 – Working with String Input and Type CastingStep 1: RemovefindErrors.cppfrom the project and add thepercentage.cppprogra

m in yourLab3 folder to the project. Here is a copy of the source code.1 // Lab 3 percentage.cpp2 // This program will determine the percentage3 // of answers a student got correct on a test.4 // PUT YOUR NAME HERE.56 // INCLUDE THE FILE NEEDED TO DO I/O7 // INCLUDE THE FILE NEEDED TO FORMAT OUTPUT8 // INCLUDE THE FILE NEEDED TO USE STRINGS9 using namespace std;1011 int main()12 {13string name;14int numQuestions,15numCorrect;16double percentage;1718// Get student's test data19cout << "Enter student's first and last name: ";20// WRITE A STATEMENT TO READ THE WHOLE NAME INTO THE name VARIABLE.2122cout << "Number of questions on the test: ";23cin >> numQuestions;24cout << "Number of answers the student got correct: ";25cin >> numCorrect;2627// Compute and display the student's % correct28// WRITE A STATEMENT TO COMPUTE THE % AND ASSIGN THE RESULT TO percentage.2930// WRITE STATEMENTS TO DISPLAY THE STUDENT'S NAME AND THEIR TEST31// PERCENTAGE WITH ONE DECIMAL POINT.3233return 0;34 }Step 2: Replace each capitalized comment with C++ code that does what the comment asks you to do.Then compile and run the program. Here is what a sample run should look like:Sample RunEnter student's first and last name: John SmithNumber of questions on the test: 40Number of answers the student got correct: 31John Smith77.5%
Engineering
1 answer:
jolli1 [7]3 years ago
4 0

Answer:

// Program is written in C++ Programming Language

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

int main ()

{

// Variable declaration

string name;

int numQuestions;

int numCorrect;

double percentage;

//Prompt to enter student's first and last name

cout<<"Enter student's first and last name";

cin>>name; // this line accepts input for variable name

cout<<"Number of question on test"; //Prompt to enter number of questions on test

cin>> numQuestions; //This line accepts Input for Variable numQuestions

cout<<"Number of answers student got correct: "; // Prompt to enter number of correct answers

cin>>numCorrect; //Enter number of correct answers

percentage = numCorrect * 100 / numQuestions; // calculate percentage

cout<<name<<" "<<percentage<<"%"; // print

return 0;

}

Explanation:

The code above calculates the percentage of a student's score in a certain test.

The code is extracted from the Question and completed after extraction.

It's written in C++ programming language

You might be interested in
THE COMPUND INTEREST ON RS 30,000AT 7% PER ANNUM IS RS 4347 THE PERIOD IN YEARS
timofeeve [1]

Answer:

what wym

Explanation:

4 0
3 years ago
Read 2 more answers
Describe the Optical Fiber Network( i need 2 paragraphs, but give me about 5 sentences or like 3)
frez [133]

Answer: Fiber Optic Network Fiber-optic networks have been used for decades to transmit large volumes of traffic across the country. The economics of fiber networks have only recently allowed for connecting the fiber directly to the home, creating a fiber-to-the-home (FTTH) network.

Explanation:

6 0
3 years ago
Read 2 more answers
The dot plot shows the number of cupcakes bought by each person who came to a bake sale.
Maslowich

The true statement about the dot plot is 1 has 4 and 0 dots.

Explanation:

  • after creating a Bar chart 4 is the right answer.
  • The highest among st all the other plots is 1 but 4 shows 3.
  • Taking an average from all the data points 3 comes to the right answer.
  • Median the central Mid-point is 3.
  • Mode also comes to 3.
  • It is skewed on the right due to the 1st one.
  • Skewed shows the data point either increasing or in decreasing.
  • There a to Bi- histograms which has two ups and downs.
  • The true statement has to be as Mean=Median=Mode is 3.

6 0
3 years ago
Why would an aerospace engineer limit the maximum angle of deflection of the control surfaces?
WITCHER [35]

Answer:

You can create high drag which allows a steeper angle without increasing your air speed on landing. you can reduce the length of landing role. Flaps are also used to increase the drag they are retracted when they are not needed. it is adviseable to down he flaps during the time of take off.

4 0
3 years ago
The formula for calculating risk considering risk perception is ?​
s2008m [1.1K]

Answer:

risk = probability x loss

Explanation:

3 0
3 years ago
Other questions:
  • Are ocean currents always cold
    10·1 answer
  • You are traveling upstream on a river at dusk. You see a buoy with the number 5 and a flashing green light . What should you do?
    8·1 answer
  • The forming section of a plastics plant puts out a continuous sheet of plastic that is 1.2 m wide and 2 mm thick at a rate of 15
    5·1 answer
  • While there are many ways to solve this problem, one strategy is to calculate the volume of any metal's unit cell given its theo
    14·1 answer
  • If noise levels are high enough that you have to raise
    7·1 answer
  • Stakeholders are people or organizations who do what?
    10·2 answers
  • What would happen if the brake pedal was released while the bleed screw was open during brake bleeding?
    7·1 answer
  • What is the purpose of the graphic language?
    15·1 answer
  • A. The ragion was colonized by European powers
    6·1 answer
  • What lump sum of money must be deposited in a bank account at present time so that Php 500 monthly can be withdrawn for five yea
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!