Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
C++ Modify your PA4 – Drop Lowest Score Program

Code a new function named grade

This is a C++ Modify your PA4 –Drop Lowest Score program by coding and implementing the functions described below.Create a new VS C++ project and firstuseWindows File Explorertocopy your PA4 source code and two library files to the project folder. Then in the VS project, ADD those threeEXISTING files to the project’s Solution Explorer. 1. Code a newfunction named gradeCode a generic, reusablevalue returningfunction of type charthat has onevalueparameterof typedoubleto receivea value representing a grade average. The function will determine the appropriate letter grade and return itas an upper-casecharacter. The letter grade shall be based on the following grading scale:90 to 100 -A, 80 to 89 -B, 70 to 79 -C, 60 to 69 -D, 0 to 59 –FFirst, check to see if the average is invalid, outside the range 0 to 100, if invalid return an ‘*’character.Use a switch statement in the implementation. Use your library round function to temporarily round the gradeaverage parameter to a whole number to determine a letter gradesuch that 89.5 would round up to 90.0 for an A. Thensince switch statements only use integers,typecastthe rounded average to an integer and convert it to a single integer by dividing by 10.Can code this before the switch and save to a localvariableto be used in the switchor can code directly inside the switch test expressionas in: switch(static_cast(round(average, 0)) / 10)Use fall-throughwhere appropriate in the case statements(see Chapter 4 slides 62 –64). Remember that a case statement can simply return a value as in:case9: return'A';And when a switch statement returns a value, the return statement causes an immediate exit from the function, therefore no break statements are requiredwithin the switch.Include a brief one-line descriptionabove the function definition to document the function.Testing:To test each selective path you will need a set of test data for each case statement in your switch statement.And for invalid data should test both values below and above the valid range 0 through 100. Can use literal test callsfor testing and commentthem out when no longer needed. When fully tested,movethe function prototype and definitionto your library filesalong with the descriptive documentation.Copy the descriptive comment below the prototype in your library .h file.Note: You may need to include your “library.h” file in your “library.cpp” file.Modification of main Function and source .cpp file.2. Modify yourdisplayStudentAveragefunction to add a call to the gradefunction coded above somewhere afterrounding the average to one decimal digit and display the grade with a line similar to: Grade assigned: A3. Code a new function named getScores.This function will be coded in your source.cpp file and will be used to further modularize the main function by gettingand returningthe four test scoresvia reference parameters(Chapter 6).Code a voidfunction that has fourint & reference parameters to return thefour test scores. voidgetScores(int& score1, int& score2, int& score3, int& score4);The parameters will store the addresses which refer to the variables in main, thereby passing the values back.The function’s body will consist of the code from main which prompts the user for and reads the four test scores. Move that code inside this function and replace it in main with a call to thisfunction. I need it to be done preferably VS or XCode. Please, help, thanks.

support
Whatsapp
callback
sales
sales chat
Whatsapp
callback
sales chat
close