Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC100AA and CIS162AB Ch 3 Program - Percentage Please adhere to the C++ Standards and Guidelines document on the class site. Submit the following: List

CSC100AA and CIS162AB Ch 3 Program - Percentage

Please adhere to the C++ Standards and Guidelines document on the class site. Submit the following:

List of source code with comments to document

Sample or tested output listed as comments at the end of your program

Exam.cpp(5 pts)

This program will determine the percentage of answers a student got correct on a test.


  1. Define a string variable to store the students full name, integer variables to store the number of questions on a test, and a number of answers the student got correct. Define a double variable to store the percentage of answers the student got correct on a test.

[Refer to textbook program 3-22 on how to use the getline function to read character data into a string object]


  1. Your program must prompt the user to enter the first name and last name and assign it to a single variable. Prompt the user to enter the number of questions on a test and the number of answers the student got correct on the test.


  1. Compute the percentage of correct answers.

[Hint: percentage = numCorrect / numQuestions * 100;]

Watch out for int/int division!

[Refer to program Program 3-7 on using type cast to avoid an int/int division]



  1. Display the students name and their test percentage to 1 decimal place.

[Refer to section 3.7 on how to format the output]



Sample output:

Enter student's first and last name: John Smith

Number of questions on the test: 40

Number of answers the student got correct: 31

John Smith 77.5%


Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

Understand the purpose and methods of cross-cultural training

Answered: 1 week ago