1. Engineering
  2. Computer Science
  3. program is to be done in c algorithm solution in...

Question: program is to be done in c algorithm solution in...

Question details

Program is to be done in c++

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"

                          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.



9 - 10








0 - 5





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

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution