Question
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.
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]
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.
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]
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started