Alright, then, here is my program.
I've already ran the program, but I still want you to run int and see what you think of it.
Thanks for the encouragement, goys!!
I've already ran the program, but I still want you to run int and see what you think of it.
Code:
#include <iostream> #include <conio> using namespace std; //Function prototype void getscore(int&, int&, int&, int&, int&); int findLowest (int, int, int, int, int, int); void calcAverage (int, int, int, int, int, int, int); int main() { int average, score1, score2, score3, score4, score5, small; getscore (score1, score2, score3, score4, score5); calcAverage (average, score1, score2, score3, score4, score5, small); getch(); return 0; } void getscore (int &score1, int &score2, int &score3, int &score4, int &score5) { cout << "Enter first score: "; cin >> score1; cout << "Enter second score: "; cin >> score2; cout << "Enter third score: "; cin >> score3; cout << "Enter fourth score: "; cin >> score4; cout << "Enter fifth score: "; cin >> score5; } void calcAverage (int average, int score1, int score2, int score3, int score4, int score5, int small) { average = ((score1 + score2 + score3 + score4 + score5)-small)/4; cout << average; } int findLowest(int small, int score1, int score2, int score3, int score4, int score5) { small =score1; if(small>score2) { small=score2; } if(small>score3) { small=score3; } if(small>score4) { small=score4; } if(small>score5) { small=score5; } return small; }
Comment