### "Lowest score drop" C++ problem

Hey guys i will just type out the problem from my textbook and then post code below that, I will admit i am a bit confused im sure there are several errors in my code but the only errors im getting right now are that my functions findLowest and calcAverage "does not take 5 arguments" line 22 and 23 in main().

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 referance 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 highest 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 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.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960`` ``````#include "stdafx.h" #include using namespace std; void getScore(int & test); void calcAverage(int test1, int test2, int test3, int test4, int test5); int findLowest(int test1, int test2, int test3, int test4, int test5, int lowest); int main() { int test1, test2, test3, test4, test5, lowest; getScore(test1); getScore(test2); getScore(test3); getScore(test4); getScore(test5); lowest = findLowest(test1, test2, test3, test4, test5); calcAverage(test1, test2, test3, test4, test5, lowest); return 0; } void getScore(int &score) { cout << "Please enter the score: "; cin >> score; while (score < 1 || score >100) { cout << "Please enter a score between 0-100:"; cin >> score; } } int findLowest(int test1, int test2, int test3, int test4, int test5) { int lowest = test1; { if (test2 < lowest) lowest = test2; else if (test3 < lowest) lowest = test3; else if (test4 < lowest) lowest = test4; else if (test5 < lowest) lowest = test5; } return lowest; } void calcAverage(int test1, int test2, int test3, int test4, int test5,int lowest) { double average; average = test1 + test2 + test3 + test4 + test5 - lowest / 4; cout << "The average is: " << average << endl; }``````
 ``12`` ``````void calcAverage(int test1, int test2, int test3, int test4, int test5); int findLowest(int test1, int test2, int test3, int test4, int test5, int lowest);``````

These don't match your function definitions. lowest should be on calcAverage.

` average = (test1 + test2 + test3 + test4 + test5 - lowest) / 4; `

Put parenthesis so the order of operations is correct.
Having so many similar arguments on a function can't be a good idea.
You should pass an array or use varargs instead.
 ``123456789101112`` ``````//calcAverage(10, 5, 1, 2, 3, 4, 5); void calcAverage(int lowest, int count, ...) { va_list args; va_start(args, count); double average = 0.0; for (int i=0; i

 ``1234567891011`` ``````//calcAverage(10, 5, {1, 2, 3, 4, 5}); void calcAverage(int lowest, int count, int const test[]) { double average = 0.0; for (int i=0; i

Last edited on
I feel like an idiot everytime i post on here.. thanks again boys! Also @Ihatov we weren't allowed to used arrays unfortunately.