Question
Algorithm solution (in pseudocode) : 1. Declare variables yourletter, theirletter that hold a single character each. 2. Declare variables yourgrade, theirgrade that hold whole numbers.
Algorithm solution (in pseudocode):
1. Declare variables yourletter, theirletter that hold a single character each.
2. Declare variables yourgrade, theirgrade that hold whole numbers.
3. Prompt
4. Read.
4A Convert percentage into single digit
5. Run code two times to get the values of yourgrade and theirgrade and assign the letters to yourletter and theirletter respectively.
6. if yourletter = E or theirletter = E
Print on the screen "Invalid input data, cannot determine who did better in the test!"
Stop the program returning a 1. otherwise if yourletter is less than theirletter
Print on the screen "You did better in the test, you need to help your partner" otherwise if yourletter is more than theirletter
Print on the screen "Your partner did better in the test, he needs to help you" otherwise
Print on the screen "There is no winner!"
The program must receive a numeric grade and return its corresponding letter equivalent according to the table shown below. Use nested-if statements similar to step 6) to determine the corresponding letter grade. Notice that for letters A and F you will need to specify a range of numbers.
Number | Letter |
9 - 10 | A |
8 | B |
7 | C |
6 | D |
0 - 5 | F |
Other | E |
------------------------------------------------------------------------------------------------------------------------
Part B (10 points)
Modify the program so that it uses a loop so the user may decide to compare to other students. Use a sentinel or flag to stop the loop.
------------------------------------------------------------------------------------------------------------------------
Part C (11 points)
Modify the above program so that when there is no winner, it prints another message below according to the following criteria:
If the letter grade is B or better display message 1, if the letter grade is C display message 2, if the letter grade is D display message 3, otherwise display message 4. Please run my program and test it with different values to see what messages 1 through 4 are equal to.
Both did very good, congratulations!
Not bad but could be better
Both should improve to avoid seeing me again next semester!
Have you considered another major?
for a B
for a C
for a D
for an
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