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]
4 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]4 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
Cars going straight or turning right have the right-of-way before you when you're making this type of turn
Paladinen [302]

Answer:

Yes. YES yes yes. Unless you are in Australia or something.

4 0
3 years ago
Write a Python program that does the following. Create a string that is a long series of words separated by spaces. The string i
dybincka [34]

Answer:

The code is attached.

Explanation:

I created a string s including 6 colors with spaces in between. Then I converted the string into a list x by using split() method. I used three different methods for removing elements from the list. These methods are remove(), pop() and del.

\\ Then I used methods append(), insert() and extend() for adding elements to the list.

\\ Finally I converted list into a string using join() and adding space in between the elements of the list.

4 0
4 years ago
11. Ten bagels is what percentage of a dozen bagels?
IRINA_888 [86]

Answer:

the answer is d 83.3%

Explanation:

3 0
3 years ago
How to update android 4.4.2 to 5.1​
faust18 [17]

Answer:

try settings and go to updates?

Explanation:

8 0
3 years ago
A tool chest has 950 N weight that acts through the midpoint of the chest. The chest is supported by feet at A and rollers at B.
Mazyrski [523]

Answer:

P > 142.5 N  (→)

the motion sliding

Explanation:

Given

W = 959 N

μs = 0.3

If we apply

∑ Fy = 0 (+↑)

Ay + By = W

If  Ay = By

2*By = W

By = W / 2

By = 950 N / 2

By = 475 N (↑)

Then  we can get F (the force of friction) as follows

F = μs*N = μs*By

F = 0.3*475 N

F = 142.5 N (←)

we can apply

P - F  > 0

P  > 142.5 N (→)

the motion sliding

6 0
3 years ago
Other questions:
  • 6. PVC boxes are primarily used in new construction because it is simple to
    11·1 answer
  • The European Space Agency launched a probe called Rosetta in March 2004. In August​ 2014, Rosetta reached its​ destination: a co
    13·1 answer
  • A device that helps increase field worker productivity by providing reliable location and time
    13·1 answer
  • Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop the program exa
    13·1 answer
  • A flywheel made of Grade 30 cast iron (UTS = 217 MPa, UCS = 763 MPa, E = 100 GPa, density = 7100 Kg/m, Poisson's ratio = 0.26) h
    9·1 answer
  • Define Viscosity. What are the main differences between viscous and inviscid flows?
    10·1 answer
  • Fill in the blank to output the quotient of dividing 100 by 42. print (100______42)​
    8·1 answer
  • 14. The flow water in a 10-in Schedule 40 pipe is to be metered. The temperature of the water is
    8·1 answer
  • Which fields of engineering use fluid power? Explain how these fields make use of fluid power systems: water supply, agricultura
    10·1 answer
  • 3. If nothing can ever be at absolute zero, why does the concept exist?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!