im a beginner in void function... my knowledge about void functions aren't that good. i just want to ask your help in this. i want to total all the commission but i don't know how..
here is my code:
Code:
#include <iostream>
using namespace std;
void calculatecomm(float y)
{
float Commission = y * .10;
}
void displaycomm(float x)
{
cout << " The commission is: $" << x * .10 << endl;
}
void totalcomm(float total)
{
float sc=0.0;
total = total + sc;
cout << " total : " << total << endl;
}
float getsales(float &s1)
{
float g=0;
cout << endl << " Input negative number to exit " << endl;
cout << " Enter sales amount: $";
cin >> s1;
while (s1 < 0)
{
totalcomm(g);
system("pause");
exit(0);
}
}
int main()
{
float s1,s2,i;
for ( i = 0; ;i++ )
{
getsales(s1);
displaycomm(s1);
}
//system ("pause");
}
i really need your help guys... tnx in advance !