also delete line 12, don't have to declare that only once at the top of the program and after the includes.
>>How do I make it execute the function once then return to ask if there is another amount
move lines 17 and 18 up above line 15. Also, there is no need to make sales a global variable. Move line 3 to be local to main() then pass it as a parameter to salesInput() function.
OK, still problems. It compiles but now it goes straight to the "Press any key to continue"
1 #include <iostream>// calls I/O library
2 using namespace std;
3 double sales;//declare sales as a double so decimals can be used
4 double salesInput()//Sales Input Function
5 {
6 const double basePay = 200;//declare base salary as a constant
7 const double grossSales = .09;//declare gross sales as a constant
8 double com;//declare commission as double so decimals can be used
9 com=((sales * 0.09) + 200);//calculation for commission
10 cout << "Total pay plus 9% commission is " <<com << endl;//output final results to the screen
11}
12 int main()
13{
14 while
15 (sales!=0 )//Start sales loop, executes function sales input if anything other than a zero is entered, if zero then exit
16 {
17 cout << "Enter the Sales for the week, enter a zero to quit"<< endl; //ask user for input
18 cin >> sales;//get input and store as variable sales
19 salesInput();//calls sales input function
20 }
21 }