cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
float function
float function
Mar 27, 2012 at 12:11pm UTC
balv11
(9)
I have to write a float function where I input 5 scores and the lowest score is thrown away and the average score is worked out for the 4 highest ones.
So if I write it as follows:
Float averageScore(float & score1, float & score2, float & score 3, float & score4n float & score5)
{
}
I want to use a if statement but don't know how to do it since I don't know what the lowest score will be. Any help?
Mar 27, 2012 at 12:14pm UTC
Peter87
(11234)
If you store all the scores in an array it will be easier to handle.
Mar 27, 2012 at 1:55pm UTC
balv11
(9)
Thanx, I didn't even think about that.
Topic archived. No new replies allowed.