I am getting a problem while using
cin >> PayRate
and
cin >> H_worked
what could be the problem? Even the compiler doesn't show any errors but when program runs the 2nd and 3rd cin
values aren't read by compiler.
Program:
#include <iostream.h>
#include<conio.h>
int main()
{
int employeeName, H_worked;
float PayRate, GrossPay, NetPay;
cout << "Please input your employee's name:";
cin >> employeeName;
cout << "Input hourly wage rate:";
cin >> PayRate;
cout << endl;
cout << "Input hours worked :";
cin >> H_worked;
cout << endl;
if (H_worked > 40)
{
H_worked = H_worked*1.5;
GrossPay = H_worked*PayRate;
cout << "Your employees gross pay for this week is" << GrossPay << endl;
NetPay = GrossPay - (GrossPay* 3.625);
cout << "Your employees net pay is" << NetPay << endl;
}
else (H_worked <= 40);
{
GrossPay = H_worked*PayRate;
cout << "Your employees gross pay for this week is" << GrossPay << endl;
NetPay = GrossPay - (GrossPay*3.625);
cout << "And your employees net pay is" << NetPay << endl;
}
return 0;
getch();
}