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
An eddy current separator is to separate aluminum product from an input streamshredded MSW. The feed rate to the separator is 2,
blsea [12.9K]

Answer:

<em>the % recovery of aluminum product is 80.5%</em>

<em>the % purity of the aluminum product is 54.7%</em>

<em></em>

Explanation:

feed rate to separator = 2500 kg/hr

in one hour, there will be 2500 kg/hr x 1 hr = 2500 kg of material is fed into the  machine

of this 2500 kg, the feed is known to contain 174 kg of aluminium and 2326 kg of rejects.

After the separation, 256 kg  is collected in the product stream.

of this 256 kg, 140 kg is aluminium.

% recovery of aluminium will be = mass of aluminium in material collected in the product stream ÷ mass of aluminium contained in the feed material

% recovery of aluminium = 140kg/174kg x 100% = <em>80.5%</em>

% purity of the aluminium product = mass of aluminium in final product ÷ total mass of product collected in product stream

% purity of the aluminium product = 140kg/256kg

x 100% = <em>54.7%</em>

8 0
3 years ago
How can we love our country? Not by words but by deeds. - Jose P. Laurel
Vadim26 [7]

Answer:

1. You have the courage to help without expecting a reward.

2. Because actions are more eloquent than words. Actions are far more valuable and counted than  words, and that's how she inspired me.

3. Doing simple things that can make someone grateful and happy  without knowing that someone is inspired and motivated by your good deeds, and also doing some interesting things By.

Explanation:

6 0
2 years ago
Given the following phasors and the information related to the frequency of that phasor, provide the corresponding time-domain r
Evgesh-ka [11]

Answer:

Explanation:

In Engineering and Physics a Phasor That is a portmanteau of phase vector, is a complex number that represents a sinusoidal function whose Amplitude (A), Angular Frequency (ω), and Initial Phase (θ) are Time-invariant.

For the step by step solution to the question you asked, go through the attached documents.

4 0
3 years ago
In order to keep an automobile operating, it is necessary to keep adding fuel as it is used up. Explain why this doesn't contrad
Semmy [17]

Answer:

There is conversion of energy from one form to another and this justifies the law of conservation of energy, which states that energy can neither be created nor destroyed but can be converted from one form to another.

Explanation:

The fuel added to automobile is a chemical energy, which provides thermal energy of the combustion engine of the automobile, which is then converted to mechanical energy of the moving parts of the automobile. Thus, there is conversion of energy from one form to another. This justifies the law of conservation of energy, which states that energy can neither be created nor destroyed but can be converted from one form to another.

3 0
2 years ago
What is the main gas that is causing climate change?
Goryan [66]

Answer:

The main gases responsible for the greenhouse effect include carbon dioxide, methane, nitrous oxide, and water vapor which all occur naturally, and fluorinated gases which are synthetic.

3 0
2 years ago
Other questions:
  • A 10-ft-long simply supported laminated wood beam consists of eight 1.5-in. by 6-in. planks glued together to form a section 6 i
    5·1 answer
  • In order to build a skyscraper Builders, Inc. hires 400 construction workers and 50 managers. Builders, Inc. represents A entrep
    8·1 answer
  • A heat pump with refrigerant-134a as the working fluid is used to keep a space at 25°C by absorbing heat from geothermal water t
    8·1 answer
  • Given the latent heat of fusion (melting) and the latent heat of vaporisation for water are Δhs = 333.2 kJ/kg and Δhv = 2257 kJ/
    15·1 answer
  • A steel rod, which is free to move, has a length of 200 mm and a diameter of 20 mm at a temperature of 15oC. If the rod is heate
    10·1 answer
  • Tech A says that LED brake lights illuminate faster than incandescent bulbs. Tech B says that LED brake lights have
    13·1 answer
  • What is the best way to collaborate with your team when publishing Instagram Stories from Hootsuite?
    14·1 answer
  • How much does it cost to replace a roof on a 2,200 square foot house.
    10·1 answer
  • If an internally piloted DCV does not shift, you should use a gauge to _____. A.check the pilot line pressure b. check the inlet
    15·1 answer
  • The ratio of the volume of charge admitted at n. T. P. To the swept volume of the piston is called.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!