Äߧý∩†H♠H䎀
Fully Optimized
- Messages
- 3,629
Alright I'm just starting this programming class and I'm not sure where I messed up on this code. Any help on getting it to build correctly would be appreciated!
I'm getting the following errors when I try and build this:
1>Lab1C.cpp(15): error C2059: syntax error : ')'
1>Lab1C.cpp(16): error C2143: syntax error : missing ';' before '{'
1>Lab1C.cpp(16): error C2447: '{' : missing function header (old-style formal list?)
1>
1>Build FAILED.
PHP:
# include <iostream>
# include <iomanip>
# include <string>
using namespace std;
void ()
{
// variables
string weeklySales = "";
const double commission = 0.07;
const double fedTaxRate = 0.18;
const double retirmentContribution = 0.10;
const double socialSecurityAmount = 0.06;
double grossWage = 0;
double fedTax = 0;
double retirement = 0;
double socialSecurity = 0;
double netWage = 0;
// gather input
<< "What was your weekly sales? ";
getline(cin, weeklySales);
cin >> weeklySales;
// calculations
grossWage = weeklySales * commission;
fedTax = grossWage * fedTaxRate;
retirement = grossWage * retirmentContribution;
socialSecurity = grossWage * socialSecurityAmount;
netWage = grossWage - fedTax - retirment - socialSecurity;
// output
cout << endl << endl;
cout << "Enter Total Sales: " << setw(12) << weeklySales << endl;
cout << "Total Sales: " << setw(12) << weeklySales << endl;
cout << "Gross Pay: " << setw(12) << grossWage << endl;
cout << setprecision(2) << fixed;
cout << "Federal tax paid: " << setw(12) << fedTax << endl;
cout << "Social security paid: " << setw(12) << socialSecurity << endl;
cout << "Retirment Contribution:" << setw(12) << retirment << endl;
cout << "Total deductions: " << setw(12) << fedTax + retirement + socialSecurity << endl;
cout << "Take home pay: " << setw(12) << endl;
system("pause");
}
I'm getting the following errors when I try and build this:
1>Lab1C.cpp(15): error C2059: syntax error : ')'
1>Lab1C.cpp(16): error C2143: syntax error : missing ';' before '{'
1>Lab1C.cpp(16): error C2447: '{' : missing function header (old-style formal list?)
1>
1>Build FAILED.