jrock
Please post questions in one forum only! There are links to a couple of guidance articles at the bottom of this, please read them.
jrock wrote (in other forum):
| Write a program that calculates the average of a group of test scores,
| where the lowest score in the group is dropped. It should use the
| following functions:
|
| a.) voidgetScore() should ask the user for a test score, store it in a
| reference parameter variable, and validate it. This function should be
| called by main once for each of the five scores to be entered.
|
| b.) voidcalcAverage() should calculate and display the average of the
| four highest scores. This function should be called just once by main, and
| should be passed the five scores.
|
| c.) int findLowest() should find and return the lowest of the five scores
| passed to it. It should be called by calcAverage, who uses the function to
| determine which of the five scores to drop.
|
| // Input validation // DO NOT ACCEPT TEST SCORES LOWER THAN 0 OR
| HIGHER THAN 100
Part a, says to use the function void getScore() to get a score...
1 2 3 4
|
void getScore(int& val)
{
...
}
|
Part b, You would have to do somthing along the line of
1 2 3 4
|
sum equals the sum of values 1 through 5
sum equals sum minus findLowest()
average = sum divided by 4
display average
|
part c, you would have somthing like
1 2 3 4 5
|
lowest value equals 100
if value 1 is less than lowest then lowest equals value 1
if value 2 is less than lowest then lowest equals value 2
...
Return lowest
|
How To Ask Questions The Smart Way
http://www.cplusplus.com/forum/articles/1295/
How to put code into your postings
http://www.cplusplus.com/forum/articles/1624/