Thanks for all the help guys. Here is the final code for the prog. Can u take a look and see if i can tweak it. But please remember that i am in a concepts 1 class and it is very basic.
CODE
#include <iostream>
#include <conio>
#include <iomanip>
#include <cstdlib>
using namespace std;
int getScores ( int &, int &, int & );
int findLowest ( int, int ,int, int);
void calcAvg (float &, int, int, int );
void displayAvg ( float );
void main ()
{
int test1 =0, test2 = 0, test3 = 0, test4 = 0, low, num1, num2, num3;
float avg = 0.0;
cout << "This program will caculate the average of the test grades ";
cout << "for the semester.\nThe lowest score will be dropped and ";
cout << "will not count towards the final average.";
cout << endl << endl;
test4 = getScores (test1, test2, test3);
low = findLowest (test1, test2, test3, test4);
cout << "\n\nThe lowest grade entered was " << low << ".\n";
cout << "It will be dropped and will not factor into the average\n\n";
cout << "Please re-enter the three highest test scores:\n";
cout << "1. ";
cin >> num1;
num1 = test1;
cout << "\n2. ";
cin >> num2;
num2 = test2;
cout << "\n3. ";
cin >> num3;
num3 = test3;
cout << endl << endl;
calcAvg (avg, test1, test2, test3);
cout << "\n";
displayAvg ( avg );
system ("pause");
}
// ********************************************************
// This function gets the 4 inital grades, returns one
// value, and changes the values of three variables in the
// function main ().
// *********************************************************
int getScores ( int & test1, int & test2, int & test3 )
{
int test4;
cout << "Please enter the grade for test 1: ";
cin >> test1;
cout << "\nPlease enter the grade for test 2: ";
cin >> test2;
cout << "\nPlease enter the grade for test 3: ";
cin >> test3;
cout << "\nPlease enter the grade for test 4: ";
cin >> test4;
return test4;
}
// ********************************************************
// This function finds the lowest grade and returns is back
// to main ()
// ********************************************************
int findLowest ( int test1, int test2, int test3, int test4)
{
int low;
if (test1 < test2 && test1 < test3 && test1 < test4)
low = test1;
if (test2 < test1 && test2 < test3 && test2 < test4)
low = test2;
if (test3 < test1 && test3 < test2 && test3 < test4)
low = test3;
if (test4 < test1 && test4 < test2 && test4 < test3)
low = test4;
return low;
}
// ************************************************************
// This function caculates the average of the three remaining
// grade and changes the value of the variable 'avg' in the
// function main ().
// ************************************************************
void calcAvg (float & avg, int test1, int test2, int test3)
{
int sum;
sum = test1 + test2 +test3;
avg = sum / 3;
}
// *******************************************************************
// This function displays the final average for the grade earned
// for the semester.
// *******************************************************************
void displayAvg (float avg)
{
cout << "The average of the three grades entered is " << avg << ".\n\n";
cout << "Please re-run the program to caculate the average of a ";
cout << "new set of grades.\n\n";
cout << "Thank You\n\n\n";
}
Thanks ahead of time. I really would have been sunk without u guys!!!!!