Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This lab assignment will be completed by pairs of students. Submissions by individual students will not be accepted under normal circumstances. The intent is that

image text in transcribed

image text in transcribed

This lab assignment will be completed by pairs of students. Submissions by individual students will not be accepted under normal circumstances. The intent is that the two students work together. 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(). 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- B+ Grade 90-100 85-89 80-84 75-79 70-74 65-69 60-64 55-59 50-54 Below 50 GRADE EQUIVALENCY GUIDE Points Description Notes 5.0 Outstanding Grades are rounded to the nearest whole number 4.5 Exemplary before converting to grade points. For example, a 4.0 Excellent grade of 74.6 is 3.5 grade points, whereas 74.4 is 3.0. 3.5 Very Good This step is part of the grade points conversion 3.0 Good process. 2.5 Satisfactory 2.0 Acceptable Grades must be between 0 and 100. 1.5 Conditional Pass Conditional Pass 0.0 Fail B C+ 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 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.9% 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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions