#include<iostream>
#include<cctype>
using namespace std;
/*To Show Error and Terminate Program*/
void error(char ch)
{
cout<<"Incorrect Input:\t"<<ch<<"\nTerminating Program";
exit(1);
}
int main()
{
char empType; //To store Employee Type
cout<<"Enter Employee Type:\t";
cin>>empType;
empType=toupper(empType);
//For Employee Type = Management
if(empType == 'M')
{
double annualSal;
char payPeriod;
double grossPay;
double FICA, Medicare, healthInsurance, netPay;
//User Data Input
cout<<"Enter Annual Salary:\t"; cin>>annualSal;
cout<<"Enter Pay Period:\t"; cin>>payPeriod;
payPeriod=toupper(payPeriod);
//Calulation of Gross Pay
if (payPeriod == 'W') grossPay=annualSal/52;
else if (payPeriod == 'B') grossPay=annualSal/26;
else if (payPeriod == 'M') grossPay=annualSal/12;
else error(payPeriod);
// Calulation of Various Deductions
FICA=grossPay*0.07; Medicare=grossPay*0.02; healthInsurance=grossPay*0.1;
netPay=grossPay-(FICA-Medicare-healthInsurance);
//Output Data
cout<<"\nGross Pay:\t\t"<<grossPay<<"\nFICA:\t\t\t"<<FICA;
cout<<"\nMedicare:\t\t"<<Medicare<<"\nHealth Insurance:\t"<<healthInsurance;
cout<<"\nNet Pay:\t\t"<<netPay;
}
// For Employee Type = Hourly
else if(empType == 'H')
{
double hourlyPay;
int noOfHours;
double grossPay, regularPay, overTimePay=0;
double FICA, Medicare, healthInsurance, netPay;
//User Data Input
cout<<"Enter Hourly Pay:\t"; cin>>hourlyPay;
cout<<"Enter No of Hours:\t"; cin>>noOfHours;
//Calulation of Regular Pay and Over Time Pay
if(noOfHours <= 40) regularPay=hourlyPay*noOfHours;
else{
regularPay=40*hourlyPay;
overTimePay=(noOfHours-40)*1.5*hourlyPay;
}
// Calulation of Gross Pay
grossPay=regularPay+overTimePay;
// Calulation of Various Deductions
FICA=grossPay*0.07; Medicare=grossPay*0.02; healthInsurance=grossPay*0.1;
netPay=grossPay-(FICA-Medicare-healthInsurance);
//Output Data
cout<<"\nRegular Pay:\t\t"<<regularPay;
if(overTimePay!=0) cout<<"\nOver Time Pay:\t\t"<<overTimePay;
cout<<"\nGross Pay:\t\t"<<grossPay<<"\nFICA:\t\t\t"<<FICA;
cout<<"\nMedicare:\t\t"<<Medicare<<"\nHealth Insurance:\t"<<healthInsurance;
cout<<"\nNet Pay:\t\t"<<netPay;
}
else error(empType);
return 1;
}
/*OUTPUT*/
/*In case of doubt do post in Comments Section!!!*/
Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user...
Before you begin, print out all the pages in this workbook. Franny's Fabric Coporation started operations on January 1, 2020. Various payroll transactions of Franny's occurred during January and February 2020. Click on "Transactions" tab at bottom of this page to view these. Required: 1 On the printed "Worksheet" page, journalize the transactions the information from the "Transactions" page. January Transactions 15 Paid an employee S. Moore net salary for January 1-15. Gross salary for the period is $1,500. Deductions...
Write a program that will compute the user annual salary. Prompt the user the enter (1) the weekly salary. Store the information in a double variable. Prompt the user to enter the number of weeks worked in a year. Use an int variable for that. Write code that will compute the user's Annual salary. Gross salary is salary before any deductions are taken. Update the code and prompt the user to enter the federal tax rate and the state's tax...
Program description: Write the necessary C++ statements (Program) to calculate the employee's weekly pay. Where : Hour = employee's work hours Rate = employee's hourly pay Wages = employee's weekly pay Given that ( Hour= 31.5 and , Rate = $11.45) Write the variable declarations and initialization sections necessary to compute and print the required calculations. The program should ask the user to input the hours and Rate of pay, then calculate the weekly Wages. Hint: Modify program in project...
Stark Company has five employees. Employees paid by the hour earn $15 per hour for the regular 40-hour workweek and $20 per hour beyond the 40 hours per week. Hourly employees are paid every two weeks, but salaried employees are paid monthly on the last biweekly payday of each month. FICA Social Security taxes are 6.2% of the first $128,400 paid to each employee, and FICA Medicare taxes are 1.45% of gross pay. FUTA taxes are 0.6% and SUTA taxes...
Program Description: Write the pseudocode for a program that will calculate and display an employee’s gross pay. Input the number of hours an employee worked for each of the 5 days of the week. Add them all up to get his hours worked for the week. Weekly Pay is calculated by adding an employee’s normal pay plus any overtime pay. Normal hours are paid at $10/hr. Any over time is paid at $15/hr. Any hours over 40 are considered overtime....
Stark Company has five employees. Employees paid by the hour earn $14 per hour for the regular 40 hour workweek and $19 per hour beyond the 40 hours per week. Hourly employees are paid every two weeks, but salaried employees are paid monthly on the last biweekly payday of each month. FICA Social Security taxes are 6.2% of the first $128,400 paid to each employee, and FICA Medicare taxes are 1.45% of gross pay. FUTA taxes are 0.6% and SUTA...
Franny's Fabric Coporation started operations on January 1, 2020. Various payroll transactions of Franny's occurred during January and February 2020. Click on "Transactions" tab at bottom of this page to view these. Required 1 On the printed "Worksheet" page, journalize the transactions the information from the "Transactions" page. Janua Transactions Paid an employee S. Moore net salary for January 1-15. Gross salary for the period is $1,500. Deductions from gross pay are as follows: The company Employee income taxes FICA...
Write a Java application with a class name of Payroll, for the “Travel Agency”, that willCalculate the weekly paycheck for both Salaried and Hourly employees. Salaried employees will be paid 1/52 of their annual pay minus 18% withheld for federal and state taxes, as well as 4% for retirement pension. Salaried employees do not collect overtime pay. There are two types of Hourly employees; permanent employees and temporary weekly employees. •Permanent weekly employees will be paid their hourly rate minus...
1. Write a C++ program that will ask the user for their full name and calculate the user's weekly salary based on their hourly wage and the number of hours they worked, assuming no overtime at this point. Sample program run: Please enter first name: Elmer Please enter middle initial (Enter space if none): J Please enter last name: Fudd Enter hours worked: 37.5 Enter hourly rate: 10.35 Your name is: Elmer J. Fudd Your weekly salary is: $388.12 2....
A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and “time-and-a-half,” i.e. 1.5 times their hourly wage, for overtime hours worked), commission workers (who receive $250 plus 5.7% of their gross weekly sales), or pieceworkers (who receive a fixed amount of money per item for each of the items they produce-each pieceworker in this company works on only one...