please help with this program. I need to calculate the highestSalesand the averageSales using float funtions and displayOutput using void, I wrote the program but I can not get the output I get a lot of confusion. please help. when I'm trying to compile i get the error cpp:5
too few arguments to function `float getSales(float, float, float, float)'
please check the program bellow.
#include <iostream>
using namespace std;
float getSales(float sales1, float sales2, float sales3, float sales4)
{
return (sales1 + sales2 + sales3 + sales4);
cout << "enter sales figure until 4: "<<endl;
cin >>sales1 >>sales2 >>sales3 >>sales4;
cout <<endl;
}
float findHighest(float sales1, float sales2, float sales3, float sales4)
{
return (sales1, sales2, sales3, sales4);
}
float calcAverage(float sales1, float sales2, float sales3, float sales4)
{
return (sales1 + sales2 + sales3 + sales4) /4;
}
void displayOutput (float highestSales, float averageSales)
{
cout.setf(ios::fixed);
cout.precision(2);
highestSales = 0;
averageSales = 0;
}
int main()
{
float sales1,
sales2,
sales3,
sales4;
float averageSales;
float highestSales;
for (int i = 0; i < 4; i++)
{
sales1 = getSales();
sales2 = getSales();
sales3 = getSales();
sales4 = getSales();
highestSales = findHighest(sales1, sales2, sales3, sales4);
averageSales = calcAverage(sales1, sales2, sales3, sales4);
displayOutput(highestSales, averageSales);
}
return 0;
}