# Noob needing some help and insight

• 02-24-2009
punktilend
Noob needing some help and insight
well i am taking c++ in college having a bit of difficulty on grasping it a bit basically im just wondering if someone could take a look to see what im doing wrong in this i would appreciate the help and criticism. like i said it is a class project so this is the project in detail:

Lowest Score Drop
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:
• void getScore() 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.
• void calcAverage() should calculate and display the average of the four high-
est scores. This function should be called just once by main, and should be passed
the five scores.
• int findLowest() should find and return the lowest of the five scores passed to
it. It should be called by calcAverage, which 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.
(Starting Out with C++: From Control Structures through Objects, 6th Edition. 03/19/2008: Addison-Wesley, 03/19/2008. 377).

#include <iostream>
using namespace std;

// function prototype
void getScore(int);
void calcAverage();

int main()
{
char restartProgram; // restarting program for next set of grades

cout << "This Program will average\n";
cout << " the test scores you input, \n";
cout << "and will drop the smallest grade." << endl;
getScore(int sum);
return 0;
}

void getScore(int sum)
{
double testScore;
int sum = 0;
int count;

do
{
for(count = 1; count <= 5; count++)
{
cout << "Enter test score number " << count << endl;
cin >> testScore;
if(testScore < 0 || testScore > 100) // make sure real test number
{
cout << testScore << " is an invalid entry. Please input correct score.\n";
break;
}
else
{
sum += testScore;
}
__________________________________________________ _____________

thanks in advance for even givin this a peek
• 02-24-2009
CornedBee
Please post code properly formatted and within code tags, to preserve that formatting.