Answered step by step
Verified Expert Solution
Link Copied!

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 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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions