Hi,
I'm fairly new to c++ and I'm having some trouble getting this to work as a function.
Here's the error I get:
error C2447: '{' : missing function header (old-style formal list?)
I can work through the minor troubleshooting of basic syntax I just don't get how to call the function properly.
Thanks!!
here's the code:
#include<iostream>// calls I/O library
usingnamespace std;
double sales;//declare sales as a double so decimals can be used
void salesInput()//Sales Input Function
{
const double basePay = 200;//declare base salary as a constant
const double grossSales = .09;//declare gross sales as a constant
double com;//declare commission as double so decimals can be used
com=((sales * 0.09) + 200);//calculation for commission
cout << "Total pay plus 9% commission is " <<com << endl;//output final results to the screen
}
usingnamespace std;
int main();
{
cout << "Enter the Sales for the week, enter a zero to quit"<< endl; //ask user for input
cin >> sales;//get input and store as variable sales
while (sales != 0 )//Start sales loop, executes function sales input if anything other than a zero is entered, if zero then exit
{
salesInput();//calls sales input function
}
cout << “You entered a zero to quit!” << endl;
return0;
}