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
Am i eating ramon nooddles rn
Elden [556K]

Answer:

You are eating ramen

Explanation:

It is shrimp flavor, yee yee

3 0
2 years ago
Read 2 more answers
The van der Waals equation is a modification of the ideal gas equation. What two factors does this equation account for? A. (1)
Liula [17]

Answer:

E

Explanation:

The vander waals equation

(P+n^2a/V^2)(V-nb)=nRT

The factor n^2a/V^2 accounts for the attractive forces between the gases molecules whereas nb accounts for the decrease in volume occupied by the gas. Therefore, correct option would be  E. None of the above have BOTH of the two factors accurately stated

6 0
3 years ago
Consider a step pn junction made of GaAs at T = 300 K. At zero bias, only 20% of the total depletion region width is in the p-si
Nat2105 [25]

Answer:

0.31 μm

Explanation:

this question wants us to Determine the depletion region width, xn​, in the n-side in unit of μm. using the information below.

density in the p-side = 5.68x10^16

density in the n-side = 1.42x10^16

\sqrt{\frac{2*12.7*8.85E-10}{1.6E-14}(\frac{1}{5.68E16}+\frac{1}{1.42E16} )(1.2)  }

= √(1.42x10⁵)(1.76056335x10⁻¹⁷ + 7.042253521x10⁻¹⁷)(1.2)

= √150.74x10⁻¹¹

= 3.882x10⁻⁵

approximately 0.39μm

xn = 0.39 x 0.8

= 0.31μm

0.31 um is the depletion region width. thank you!

3 0
3 years ago
A 0.25" diameter A36 steel rivet connects two 1" wide by .25" thick 6061-T6 Al strips in a single lap shear joint. The shear str
just olya [345]

Answer:

Option B

1025 psi

Explanation:

In a single shear, the shear area is \frac {\pi d^{2}}{4}=\frac {\pi 0.25^{2}}{4}

The shear strength=0.58\sigma_y and in this case \sigma_y=36 000 psi

Shear strength=\frac {Load}{Shear area} hence making load the subject then

Load=Shear area X Shear strength

Load=\frac {\pi 0.25^{2}}{4} \times 0.58\times 36000\approx 1025 psi

3 0
3 years ago
If 1 uF capacitor is fully charged with 120 V across it, how much energy is stored in it? (a) 7.2 kJ (b) 7.2 mJ (c) 0.12 mJ (d)
jeyben [28]

Answer:

(b) 7.2 mJ

Explanation:

ENERGY STORED IN CAPACITOR: the energy is stored in capacitor in electric field

which can be calculated by expressions

E=\frac{1}{2} c v{^2}

=\frac{1}{2} 10^{-6}120^{2}

=7200×10^{-6} J

= 7.2×10^{-3} J

=7.2 mJ

4 0
2 years ago
Other questions:
  • List fabrication methods of composite Materials.
    12·1 answer
  • 14. Tires are rotated to
    12·2 answers
  • Select the correct answer.
    5·1 answer
  • Two engineers are discussing the various merits of hydroelectricity. Engineer A says that tidal barrage systems can generate ele
    6·1 answer
  • Select the correct answer.
    6·1 answer
  • How do guest room hotel smoke alarms work and differ then regular home versions?
    10·2 answers
  • Which of the following best describes the basic purpose of the internet?
    7·2 answers
  • Select the correct answer. Felix aspires to be an engineer working for the government. What credentials will Felix require to ap
    5·1 answer
  • Dangerous of overloading in a circuit,​
    6·1 answer
  • below is an attempt at implementing a circle class. the class should feature a constructor that takes a starting radius, a float
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!