It pops up and shows these messages when compiling, but I couldn't figure out what's wrong, can anyone help me? I just want to write a program where user types in the gross pay and it calculates the amount and outputs that.
It shows these errors:
(26): error C2146: syntax error : missing ';' before identifier 'endl'
(26): warning C4551: function call missing argument list
(27): error C2065: 'amount' : undeclared identifier
(28): error C2065: 'NetPay' : undeclared identifier
(28): error C2065: 'amount' : undeclared identifier
(28): error C2065: 'amount' : undeclared identifier
(28): error C2065: 'federalTax' : undeclared identifier
(28): error C2065: 'amount' : undeclared identifier
(28): error C2065: 'stateTax' : undeclared identifier
(28): error C2065: 'amount' : undeclared identifier
(28): error C2065: 'socialSecurityAndMedicareTax' : undeclared identifier
(28): error C2065: 'healthInsurance' : undeclared identifier
(29): error C2065: 'NetPay' : undeclared identifier
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
// Paycheck project
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
string firstName,
lastName,
month,
year,
double amount,
const double federalTax = .15,
stateTax = .035,
socialSecurityAndMedicareTax = .085,
healthInsurance = 75;
cout << "Please enter your first name." << endl;
cin >> firstName >> endl;
cout << "Please enter your last name." << endl;
cin >> lastName >> endl;
cout << "Please eneter the month of your paycheck." << endl;
cin >> month >> endl;
cout << "Please enter the year of your paycheck." << endl;
cin >> year >> endl;
cout << "Please enter the gross pay of your paycheck." endl;
cin >> amount >> endl;
NetPay = amount-(amount*federalTax)-(amount*stateTax)-(amount*socialSecurityAndMedicareTax)-(healthInsurance);
cout << setprecision(2) << fixed << NetPay << endl;
return 0;
}
|
Thanks for help in advance!