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
write down your own definition of Engineering, preferably in 4-5 sentences. Maximum of 150 words for your definition???.​
ollegr [7]

Answer:

A charge q1=7.0mc is located at the origin and a second charge q2=-5.0mc is located on the x axis, 0.3m the origin find the electric field at the point p which he's coordinates (0,0.40)m

4 0
3 years ago
Design a 7.5-V zener regulator circuit using a 7.5-V zener specified at 10mA. The zener has an incremental resistance of rZ = 30
hram777 [196]

Answer:

The answer is given in the explanation.

Explanation:

The circuit is as indicated in the attached figure.

From the analytical description the zener voltage is given as

V_z=V_z_o+I_zr_z

Here

Vzo is the voltage at which the slope of 1/rz intersects the voltage axis it is equal to knee voltage.

The equivalent model is shown in the attached figure.

From the above equation, Vzo is calculated as

V_z_o=V_z-I_zr_z

Here Vz is given as 7.5 V

Iz is given as 10 mA

rz is given as 30 Ω

Thus the Vzo is given as

V_z_o=V_z-I_zr_z\\V_z_o=7.4-30*10*10^{-3}\\V_z_o=7.5-0.3\\V_z_o=7.2 V

The value of I_L is given as 5 mA

Now the expression of current is as

I=I_z+I_L\\I=10mA+5mA\\I=15 mA

Now the resistance is calculated as

R=\dfrac{V-Vo}{I}\\R=\dfrac{10-7.2}{15*10^{-3}}\\R=186.66

So the value of resistance is 186.66 Ω.

Considering the supply voltage is increased by 10%

V is 10-10%*10=10+1=11 so the

R=\dfrac{V-Vo}{I}\\186.66=\dfrac{11-V_o}{15*10^{-3}}\\V_o=8.2 V

Considering the supply voltage is decreased by 10%

V is 10-10%*10=10-1=9 so the

R=\dfrac{V-Vo}{I}\\186.66=\dfrac{9-V_o}{15*10^{-3}}\\V_o=6.2 V

Now if the supply voltage is 10% high and the value of Load is removed i.e I=Iz only which is 10mA

so

R=\dfrac{V-Vo}{I'}\\186.66=\dfrac{11-V_o}{10*10^{-3}}\\V_o=9.13 V

Now the largest load current thus that the supply voltage is 10% low and the current of zener is knee current thus

V_z_o=V_z-I_zr_z\\V_z_o=7.5-30*0.5*10^{-3}\\V_z_o=7.5-0.015\\V_z_o=7.485 V

R=\dfrac{V-Vo}{I'}\\186.66=\dfrac{9-7.485}{I}\\I=10.71 mA

The load voltage is 7.485 V

8 0
3 years ago
Using the state mileage guide table located on the top of each map page you can
Ivenika [448]
C. Route and roadways defined as class I highways
5 0
3 years ago
Most motor vehicle crashes in Florida in 2016 occurred on
vlada-n [284]
Most Motor Vehicle catches in Florida in 2016 occurred on Motorcycles. Another option could be roads.
4 0
4 years ago
Read 2 more answers
Steam enters an adiabatic turbine at 10 MPa and 500°C and leaves at 10 kPa with a quality of 90 percent. Neglecting the changes
Anna35 [415]

Answer:

The mass flow rate of steam m=5.4 Kg/s

Explanation:

Given:

  At the inlet of turbine P=10 MPa  ,T=500 C

 AT the exit of turbine  P=10 KPa   ,x=0.9

 Required power=5 MW

From steam table

<u> At 10 MPa and 500 C:</u>

  h=3374 KJ/Kg  ,s=6.59 KJ/Kg-K  (Super heated steam table)

<u>At 10 KPa:</u>

h_g=2675.1 KJ/Kg, h_f=417.51  KJ/Kg

s_g= 7.3  KJ/Kg-K                ,s_f=1.3   KJ/Kg-K

So enthalpy of steam at the exit of turbine

h= h_f+x(h_g- h_f)

Now by putting the values

h= 417.51+0.9(2675.1- 417.51) KJ/Kg

h=2449.34  KJ/Kg

Lets take m is the mass flow rate of steam

So 5\times 10^3=m\times (3374-2449.34)

m=5.4 Kg/s

So the mass flow rate of steam m=5.4 Kg/s

8 0
3 years ago
Other questions:
  • Suppose that the president of a small island nation has decided to increase government spending by constructing three beach reso
    11·1 answer
  • The air contained in a room loses heat to the surroundings at a rate of 60 kJ/min while work is supplied to the room by computer
    7·2 answers
  • A light pressure vessel is made of 2024-T3 aluminum alloy tubing with suitable end closures. This cylinder has a 90mm OD, a 1.65
    8·1 answer
  • Carbon dioxide (CO2) expands isothermally at steady state with no irreversibilities through a turbine from 10 bar, 500 K to 2 ba
    15·1 answer
  • Scheduling can best be defined as the process used to determine:​
    8·1 answer
  • How do i open a door<br> please i've been trapped in this room for ages
    9·1 answer
  • Our rule-of-thumb for presenting final results is to round to three significant digits or four if the first digit is a one. By t
    12·1 answer
  • What are the most used electronic tools for electronic works?​
    13·1 answer
  • soy nueva en esto me pudieran ayudar nadie me ayuda soy de peru y no endiendo nada de lo que me dicen alguie me puediera explica
    10·1 answer
  • Water flow enters a pipe at a velocity of 1m/s. The pipe inlet is 10cm. The pipe outlet is 6cm. 1. Determine the velocity of the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!