I really don't know where to began with this assignment. I have to calculae the average of a series of test scores where the lowest score in the series is dropped.

1. GetVaules should ask for fiv test scores and store them in variables.

2. Findlowest should determine which of the five scores is the lowest, and return that vaule.
3. CalcAverage should calculate and display the average of the four highest scores. Not accepting scores greaten that 100 or less than 0. In put Five test scores.

I did 2 out of 3, I don't know how to calcavg. Hopefully I did the first 2 right. PLEASE HELP. Here is my code::

P.s. Remeber I am a BEGINNER!!!

#include <iostream.h>

void main ()
{
"function protype";
void Getvalues (double scores);
int findlowest();
int calcaverage();
}

void Getvalues()
{

int score 1, score 2, score 3, score 4, score 5;
cout<<"Please enter five test scores."<<end1;
cin>>score 1>> score 2>> score 3>> score 4>> score 5;

}

int findlowest ()
{
if (score 1, score 2, score 3, score 4, score 5 > = 100)
lowestscore = < 0;

2. In the future, please use code tags.
1. GetVaules should ask for fiv test scores and store them in variables.
It is probably better to use an array for this like so
Code:
```int scores[5];
cout<<"please enter the values"<<endl;
for (int i=0;i<5;i++){
cin>>scores[i];
}```
Code:
```int findlowest ()
{
if (score 1, score 2, score 3, score 4, score 5 > = 100)
lowestscore = < 0;```
This will not work for several reasons. Try something like this:
Code:
```int lowest=scores[0];
for (int i=1;i<5;i++){
if (scores[i]<lowest) lowest=scores[i];
}```
to average a number of values, just add them up and divide by the number of values.

I hope this helps. The code I gave you probably has some syntax errors in there somewhere, but they are probably easy to fix (I'm kinda tired)

3. You might want to make Values global(aka defined outside any function) otherwise your other functions won't be able to reference them.

Originally posted by Cnote

Code:
```#include <iostream.h>

void main ()      // Should be int main
{
"function protype";     // This has no meaning and is an error
// What you probably mean is // function prototype
void Getvalues (double scores);     // Either declare the prototypes before main or code the whole function before main
int findlowest();
int calcaverage();
}

void Getvalues()
{

int score 1, score 2, score 3, score 4, score 5;
cout<<"Please enter five test scores."<<end1;
cin>>score 1>> score 2>> score 3>> score 4>> score 5;

}

int findlowest ()
{
if (score 1, score 2, score 3, score 4,  score 5 > = 100)
lowestscore = < 0;```
Other stuff like fyodor says.

5. Thank you sooo much. That was a great help! Now, the way I int calcuavg, values and findlowest was ok, I take it?

Popular pages Recent additions