Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are a tired professor and need help determining the final grades at the end of your C + + Programming course. You decide to

You are a tired professor and need help determining the final grades at the end of your C++ Programming course. You decide to write a program that converts a numerical grade into a letter grade and corresponding GPA.
Specifications:
You must use a switch statement to solve the problem,
Prompt the user to enter a numerical grade (assume it is an integer). Then use the following scores to determine the final letter grade and GPA:
\table[[Numerical Score,Letter Grade,GPA],[90-100,A,4.0],[80-89,B,3.0],[70-79,C,2.0],[60-69,D,1,0],[0-59,F,0.0]]
Print an error message if the grade is larger than 100 or less than 0.
HINT: Use an if-else statement to determine if you have an invalid grade, and if so, print an error message. Otherwise jump into your switch statement. Additionally, break the grade into two digits and use the switch statement to test the ten's digit.
If you execute the program with the following underlined inputs, the output will be:
(First Run):
Welcome to the Grade Calculation Program
Enter Numerical Grade: -67?
Error: Invalid Numerical Grade
(Second Run):
Welcome to the Grade Calculation Programming
Enter Numerical Grade: 88?
Letter Grade: B
GPA: 3.0
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

=+What kinds of problems need to be overcome?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago