Assignmentβs Instructions
Write a C++ program which performs the following steps. Pay attention to any of the compilerβs warning messages. Remember to comment your code. Comments should explain every major step in your code.
- Display the selection menu shown in Figure 1.
- Process the userβs selection using a πππΌππΆπ» structure and ensure to account for lowercase and uppercase entries.
- If the user enters A ππ π , invoke the function ππππππππππ . Once done, prompt the user again.
- If the user enters B ππ π , invoke the function ππππππ’πππππ¦ . Once done, prompt the user again.
- If the user enters C ππ π , terminate the program and print the message πππππππ π‘πππππππ‘ππ.
- If the user enters another value, show an error message and PROMPT the user again. The program should never terminate unless the user selects the exit option.
- πππ‘πΏππ‘π‘πππΊππππ : accepts one parameter of type πππππ‘ and returns the corresponding letter grade as follows:
| Range | Letter Grade | |
| 0 | 59 | F |
| 60 | 69 | D |
| 70 | 79 | C |
| 80 | 89 | B |
| 90 | 100 | A |
| Other | X | |
- πππππ‘πΊπππππππππ : utilizes the function πππ‘πΏππ‘π‘πππΊππππ and prints the table shown in Figure 4. You may pick the proper column width to format and print the table.
- ππππππ’πππππ¦ :
- Open the file “grades.dat”.
- If the file cannot be opened, display the error message “πΈππππ, ππππππ‘ ππππ ππππ: ππππππ . πππ‘”
- Once the file is successfully opened, print the table shown in Figure 6 and use the function πππ‘πΏππ‘π‘πππΊππππ .
- Compute and print the ππππππ’π, πππ₯πππ’π, and ππ£πππππ of all grades in the file. See the bottom of Figure 6
Assessment:
Figures
Β
Figure 1: Selection Menu
Figure 2: invalid entries print an error message and prompts the user again
Figure 3: option βcβ terminates the program. Note the message before the program ends.
Figure 4: option βAβ prints the letter conversion table and prompts the user again
Figure 5: option βBβ prints an error message if the file cannot be opened and prompts the user again
Figure 6: option βBβ reads the file grades.dat, prints the table and prompts the user again



