Question: Topics Branches if statement if/else statement Description Write a program that will determine whether the user passed or failed a test. The program will ask
Topics
Branches
if statement
if/else statement
Description
Write a program that will determine whether the user passed or failed a test. The program will ask the user to input the following:
Percent Pass Score
This represents the minimum percent scores required to pass the test.
Maximum Test Score
This represents the maximum total scores in the test.
User Test Score
This represents the actual scores obtained by the user in the test.
From the above input values, the program will compute the user percent scores in the test. It will compare the percent user score with the percent pass score. If the user percent score is equal to or greater than the percent pass score, the program will consider the user having passed the test. Otherwise, the program will consider the user having failed the test. At the end, the program will display the result summary. See the Test section below.
Testing
Input Test Run 1
(User input is shown in bold)
Enter Percent Pass Score:
80
Enter Maximum Test Score:
400
Enter User Test Score:
324
Output Test Run 1
Result Summary
Maximum Score = 400
User Test Score = 324
User Percent Score = 81.0%
Percent Pass Score = 80.0%
Test Result = Passed
Input Test Run 2
(User input is shown in bold)
Enter Percent Pass Score:
80
Enter Maximum Test Score:
400
Enter User Test Score:
316
Output Test Run 2
Result Summary
Maximum Score = 400
User Test Score = 316
User Percent Score = 79.0%
Percent Pass Score = 80.0%
Test Result = Failed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
