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
Drag each item to show if it is an element or not an element.
Flauer [41]

Answer:

CARBON

Explanation:

HOPE THIS HELPS SORRY FOR CAPS

5 0
3 years ago
Small droplets of carbon tetrachloride at 68 °F are formed with a spray nozzle. If the average diameter of the droplets is 200 u
Licemer1 [7]

Answer:

the difference in pressure between the inside and outside of the droplets is 538 Pa

Explanation:

given data

temperature = 68 °F

average diameter = 200 µm

to find out

what is the difference in pressure between the inside and outside of the droplets

solution

we know here surface tension of carbon tetra chloride at 68 °F is get from table 1.6 physical properties of liquid that is

σ = 2.69 × 10^{-2} N/m

so average radius = \frac{diameter}{2} =  100 µm = 100 ×10^{-6} m

now here we know relation between pressure difference and surface tension

so we can derive difference pressure as

2π×σ×r = Δp×π×r²    .....................1

here r is radius and  Δp pressure difference and σ surface tension

Δp = \frac{2 \sigma }{r}    

put here value

Δp = \frac{2*2.69*10^{-2}}{100*10^{-6}}  

Δp = 538

so the difference in pressure between the inside and outside of the droplets is 538 Pa

7 0
3 years ago
The first thing you should do is develop a ____________________ to determine what vehicle you can afford.
swat32

The first thing you should do is develop a <u>budget</u> to determine what vehicle you can afford.

<h3>What is an automobile?</h3>

An automobile is also referred to as a vehicle, car or motorcar and it can be defined as a four-wheeled vehicle that is designed and developed to be propelled by an internal-combustion (gasoline) engine, especially for the purpose of transportation from one location to another.

<h3>What is a budget?</h3>

A budget can be defined as a financial plan that is typically used for the estimation of revenue and expenditures of an individual, business organization or government for a specified period of time, often one year.

In this context, we can reasonably infer and logically deduce that the first thing anyone should do is to develop a <u>budget</u> in order to determine what vehicle they can afford.

Read more on budget here: brainly.com/question/13964173

#SPJ1

7 0
1 year ago
A 1000-turn coil of wire 1.0 cm in diameter is in a magnetic field that increases from 0.10 T to 0.30 T in 10 ms. The axis of th
ddd [48]

emf generated by the coil is 1.57 V

Explanation:

Given details-

Number of turns of wire- 1000 turns

The diameter of the wire coil- 1 cm

Magnetic field (Initial)= 0.10 T

Magnetic Field (Final)=0.30 T

Time=10 ms

The orientation of the axis of the coil= parallel to the field.

We know that EMF of the coil is mathematically represented as –

E=N(ΔФ/Δt)

Where E= emf generated

ΔФ= change inmagnetic flux

Δt= change in time

N= no of turns*area of the coil

Substituting the values of the above variables

=1000*3.14*0.5*10-4

=.0785

E=0.0785(.2/10*10-3)

=1.57 V

Thus, the emf generated is 1.57 V

4 0
3 years ago
Initially when 1000.00 mL of water at 10oC are poured into a glass cylinder, the height of the water column is 1000.00 mm. The w
Dafna11 [192]

Answer:

\mathbf{h_2 =1021.9 \  mm}

Explanation:

Given that :

The initial volume of water V_1 = 1000.00 mL = 1000000 mm³

The initial temperature of the water  T_1 = 10° C

The height of the water column h = 1000.00 mm

The final temperature of the water T_2 = 70° C

The coefficient of thermal expansion for the glass is  ∝ = 3.8*10^{-6 } mm/mm  \ per ^oC

The objective is to determine the the depth of the water column

In order to do that we will need to determine the volume of the water.

We obtain the data for physical properties of water at standard sea level atmospheric from pressure tables; So:

At temperature T_1 = 10 ^ 0C  the density of the water is \rho = 999.7 \ kg/m^3

At temperature T_2 = 70^0 C  the density of the water is \rho = 977.8 \ kg/m^3

The mass of the water is  \rho V = \rho _1 V_1 = \rho _2 V_2

Thus; we can say \rho _1 V_1 = \rho _2 V_2;

⇒ 999.7 \ kg/m^3*1000 \ mL = 977.8 \ kg/m^3 *V_2

V_2 = \dfrac{999.7 \ kg/m^3*1000 \ mL}{977.8 \ kg/m^3 }

V_2 = 1022.40 \ mL

v_2 = 1022400 \ mm^3

Thus, the volume of the water after heating to a required temperature of  70^0C is 1022400 mm³

However; taking an integral look at this process; the volume of the water before heating can be deduced by the relation:

V_1 = A_1 *h_1

The area of the water before heating is:

A_1 = \dfrac{V_1}{h_1}

A_1 = \dfrac{1000000}{1000}

A_1 = 1000 \ mm^2

The area of the heated water is :

A_2 = A_1 (1  + \Delta t  \alpha )^2

A_2 = A_1 (1  + (T_2-T_1) \alpha )^2

A_2 = 1000 (1  + (70-10) 3.8*10^{-6} )^2

A_2 = 1000.5 \ mm^2

Finally, the depth of the heated hot water is:

h_2 = \dfrac{V_2}{A_2}

h_2 = \dfrac{1022400}{1000.5}

\mathbf{h_2 =1021.9 \  mm}

Hence the depth of the heated hot  water is \mathbf{h_2 =1021.9 \  mm}

4 0
3 years ago
Other questions:
  • 5. Which of these least accurately describes what happens when abnormal combustion raises the temperature and pressure inside th
    8·1 answer
  • How do batteries and other types of power sources make physical computing systems more mobile?
    15·2 answers
  • in a vehicle you're servicing the fuel pressure drops rapidly when the engine is says that one or more turned off. Technician a
    7·1 answer
  • Two gases—neon and air—are expanded from P1 to P2 in a closed-system polytropic process with n = 1.2. _____ produces more work w
    7·1 answer
  • Ventajas motor avion
    5·1 answer
  • What are probiotic bacteria and how did Danino and his team use this type of bacteria to detect liver cancer?
    15·1 answer
  • A slab-milling operation is performed on a 0.7 m long, 30 mm-wide cast-iron block with a feed of 0.25 mm/tooth and depth of cut
    14·1 answer
  • You need to lower your lift onto the mechanical load-holding devices to provide structural support before working under the lift
    12·1 answer
  • Plz help electrical technology
    15·2 answers
  • Engineers please help im not good when it comes to drawing​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!