Question: Use functional decomposition to solve this problem and implement the solution in C + + . That is , implement your solution using functions. The

Use functional decomposition to solve this problem and implement the solution in
C++. That is, implement your solution using functions.
The problem to solve is to read a test score value from the keyboard and then
calculate and display grade based on the score entered.
There should be a function called printInfo() to display basic information about
the program. This function has this prototype:
void printInfo()
Testing: You should test only this function from your main() function to make sure
it works before proceed.
Add pre-conditions and post-conditions documentation to your function.
There should also be a function called getScore() to read test score value from
the keyboard. This function must validate that test score accepted must be in the
range from 0 to 100. Any other value should display an error message and prompt
user to enter another score value. Function will return only a valid score value.
This getScore() function will have the following prototype.
int getScore();
Testing: You should test only this getScore() function from your main() function
to make sure it works before proceed.
You should print the test score returned (in your main() function) and make sure
you get the correct value enter in the getScore() function.
Add pre-conditions and post-conditions documentation to your function.
There should be a function called findGrade() that will receive the valid test
score value and then figure out the correct grade and return it to the caller. This
function has this prototype:
char findGrade(int);
The grade will be set according to this table.
Test Score Grade
90100 A
8089 B
7079 C
6069 D
059 F
Note: That you dont need to worry about invalid grade because only valid scores
are coming to this function.
Add pre-conditions and post-conditions documentation to your function.
Testing: You should test only this findGrade() function from your main() function
to make sure it works before proceed.
Lastly, there should be a void function printInfo() that will accept the score and
grade and then print them out.
This function will have this prototype:
void printInfo(int,char);
Add pre-conditions and post-conditions documentation to your function.
Remember to use meaningful names for your variables.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!