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
In response to the market revolution:the legal system worked with local governments to find better ways to regulate entrepreneur
Nataliya [291]

Answer:

Local judges protected businessmen from paying property damages associated with factory construction and from workers seeking to unionize.

Explanation:

The Market Revolution is the name given to change in the economy that occurred in the 19th century. This drastic change led to various important changes in the United States and across the world. During this period, capitalism became more entrenched and society became, for the first time, predominantly capitalist. This gave businessmen great power, as they played an increasingly important role when it came to economic growth. The power that they had influenced society deeply, including legislation. Judges often protected businessmen from paying property damages that were associated with their business enterprises. Moreover, workers had few rights and protections, and judges prevented them from unionizing.

5 0
3 years ago
Given frequency, what is the formula for the period of a wave?
Veronika [31]

Answer:

f = c / λ = wave speed c (m/s) / wavelength λ (m). The formula for time is: T (period) = 1 / f (frequency). λ = c / f = wave speed c (m/s) / frequency f (Hz). The unit hertz (Hz) was once called cps = cycles per second.

Explanation:

7 0
2 years ago
Yoda: sees corona<br> also yoda: wont last coronavirus will made in china it was!
zmey [24]

Answer:

yes!

Explanation:

7 0
3 years ago
Read 2 more answers
Please help meeeee. I don’t have time
Sholpan [36]

Answer: precision

Explanation: because accuracy is right on there and precision is getting closer and closer

3 0
3 years ago
3 facts about the Tokyo Skytree tower
vivado [14]

Answer:

Skytree is the tallest tower in the world

Skytree is not the tallest structure in the world

Nearly 8,000 people were expected at the opening

Pairing form with function, Skytree will serve as a TV and radio broadcast tower

8 0
3 years ago
Other questions:
  • 9) A construction company employs 2 sales engineers. Engineer 1 does the work in estimating cost for 70% of jobs bid by the comp
    11·1 answer
  • Name two types of Transformers.
    6·1 answer
  • A 300 mm long steel bar with a square cross section (25 mm per edge) is pulled in tension with a load of 83,051 N , and experien
    10·1 answer
  • You are in charge of ordering the concrete for a basement wall concrete pour. The wall forms are all set up and ready. The wall
    7·1 answer
  • Give an example of one technology that is well matched to the needs of the environment, and one technology that is not.
    9·1 answer
  • A cylinder fitted with a movable piston contains water at 3 MPa with 50% quality, at which point the volume is 20 L. The water n
    8·2 answers
  • Question 3. Assign boston_under_10 and manila_under_10 to the percentage of rides that are less than 10 minutes in their respect
    14·1 answer
  • How many millimeters are there in a centimeter?
    10·1 answer
  • 9. What power tool incorporates a set of dies and punches to cut new
    8·1 answer
  • The controller determines if a(n) _________ exists by calculating the difference between the SP and the PV.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!