please help with C++ program

Please help I want to write three float function one for getSales to ask the user for a sales figure and return the sale figure, another one for findHighest that passed the four sales figure, determine and return the highest sales figure, and another float function calcAverage that passed the four sale figure, determine and return the average sale figure.

And then a void function displayOutput that passed the highest sales figure and the average sales, and then display the highest sales figure and the average sales.

I wrote the program bellow but is not working, when compiling I get the error message error cpp:5 too few arguments to function `float getSales(float, float, float, float)'







#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;
}

Topic archived. No new replies allowed.