Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This will be done using C++ using Dev-C++ IDE You will write a program that will prompt the user to enter a grade out of

This will be done using C++ using Dev-C++ IDE

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().

Functions - GPA Calculator

image text in transcribed

Following the Sample Output for formatting

image text in transcribed

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. Points Letter | A+ A A- 4.0 Grade 90-100 85-89 80-84 75-79 70-74 65-69 60-64 55-59 50-54 Below 50 GRADE EQUIVALENCY GUIDE1 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 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 range). 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. Sample Output Use the following example as a guide to what the program output should look like. You do not need to replicate this output exactly, but it should be very close. Enter percentage grades to convert to grade points. Enter '-1' to quit. Percentage grade: chicken * Invalid input. Please try again and enter a numeric value. 85.2 85.0% is 4.5 grade points. Percentage grade: 84.6 85.0% is 4.5 grade points. Percentage grade: 505 An exception occurred: Grade must be between 0.000000 and 100.000000 Percentage grade: -1 Good-bye

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

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago

Question

Define Management or What is Management?

Answered: 1 week ago