J Inc. has 2 employees. You are asked to write a C++ program calculate the salary for each employee. From the
keyboard, read a person’s first name, last name, id, wage, the number of hours worked in a week, and his or her
status. For the output, you must display all the inputs, straight time pay, overtime pay, employee status and net
pay. For full-time employees, $10 is deducted from wages for union fees. A person is full-time if the status is F.
Time and a half is paid for any time worked over 40 hours in a week. Make sure the output is formatted into rows
and columns and includes the appropriate titles and column headings, and it should like a Pay Check.
This is what I have so far:
#include <iostream>
#include <string>
using namespace std;
int main (void)
{
int employeeID, hrsWorked,hourlyWage, totalPay, finalPay;
int fullTimeHours (40);
//int overPay ();
//int deduction (10);
char fullTime = 'F';
char part_Time = 'P';
//user inputs
string firstName ("");
cout << "Please enter employee's first name :\t" << endl;
cin >> firstName;
string LastName ("");
cout << "Please enter employee's last name :\t" << endl;
cin >> LastName;
totalPay - deduction = finalPay;
else
(jobStatus == P)
cout << "Job Status: Part - Time\t" << P <<endl;
}
return 0;
}
I tested all my inputs and they are working correctly. I don't have output statements yet but don't worry about those. I am worried about the if statement. I tried to nest and I am wondering if I am doing it correctly. Secondly am I using the char correctly in the if statement? Does the set up calculation look correct? Please see problem above.
I haven't paid attention to the logic details, but have merely fixed some syntax for you. Please wrap your code in [ code ] tags in the future, thanks.