Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 preconditions and postconditions 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 to 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 preconditions and postconditions 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 findGradeint;
The grade will be set according to this table.
Test Score Grade
A
B
C
D
F
Note: That you dont need to worry about invalid grade because only valid scores
are coming to this function.
Add preconditions and postconditions 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 printInfointchar;
Add preconditions and postconditions documentation to your function.
Remember to use meaningful names for your variables.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started