Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is done in C++ You will write a program that will prompt the user to enter a grade out of 100 and then show

This is done in C++

You will write a program that will prompt the user to enter a grade out of 100 and then show them what the equivalent grade points value is. The main() function will handle the input and output tasks, but the actual conversion will occur in a function called GradePoints().

image text in transcribed

I have seen other answers to this question however the declarations were hard to follow. I'm also not sure how to round the gradepoints in the output.

GradePoints Specifications This function is strictly a processing function, meaning that there are no console input or output steps in the actual function. Consider that this function may be re-used in a Windows Forms based program later, so cin and cout might not make sense. This function will have one parameter only. This parameter will be the grade out of 100 that needs to be converted. Note that part of the conversion process includes rounding off the grade to the nearest whole number, and we want this rounding to effect the original variable holding the grade. Consider whether this parameter should be pass-by-value or pass-by-reference. This function will result in one of two outcomes. If the parameter is between 0 and 100, the function will round off the grade to the nearest whole number and return the equivalent GPA value. Use the table below for the equivalencies. Otherwise, if the grade coming in is not between 0 and 100, the function will throw a std::out_of_range exception. Letter A+ A A- Grade 90-100 85-89 80-84 - 75-79 70-74 65-69 60-64 55-59 50-54 Below 50 GRADE EQUIVALENCY GUIDE 1 Description Notes Outstanding Grades are rounded to the nearest whole number Exemplary before converting to grade points. For example, a Excellent grade of 74.6 is 3.5 grade points, whereas 74.4 is 3.0. Very Good This step is part of the grade points conversion Good process. Satisfactory Acceptable Grades must be between 0 and 100. Conditional Pass Conditional Pass Fail Points 5.0 4.5 4.0 3.5 3.0 2.5 2.0 1.5 1.0 00 | D+ D- F Program Specifications The primary purpose of the main() function is to allow you to fully test the GradePoints() function. Prompt the user to enter a grade. Make sure the user input is numeric before proceeding, but do not validate for domain (i.e. checking if the input is in a valid ran Accept any numeric value. Pass this grade to your GradePoints() function to perform the processing. Display the rounded grade and the GPA value to the user, or, if the function throws any std::exception, display information about the exception thrown. Do the above steps in a loop until the user wants to quit. There are several ways you could structure this. Consider asking the user to enter a sentinel value, e.g. -1, instead of a grade to signal that they want to quit the loop

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

More Books

Students also viewed these Databases questions

Question

Could you describe how a new bond issue with warrants is valued?

Answered: 1 week ago