Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have the question and the answer but I need to apply While loop Payroll: include input validation for the Hours (0-60) Rate (15-50) Apply

I have the question and the answer but I need to apply

While loop

Payroll: include input validation for the

Hours (0-60)

Rate (15-50)

Apply while loop to repeat the program

Calculate overall gross (accumulator)

Display how many time you run the program (counter)

Display the gross ave(Acc/count )

Write c++ program which accepts employees information such as first name, last name middle initial, ID number, hours work, rate per hours employee is to pay union

Fees 7% of gross and 15% in taxes

Calculate the gross, union fees , taxes and net

Formulas if hours work <= 40

Gross = hours worked * rate per hour

Hours worked > 40

Gross =(40*rate per hour)+(hours worked -40)*(rate per hour* 1.5)

Output

Company xyz

Firs name:

Middle initial :

Last name :

ID:

Hours worked :

Rate per hour :

Gross :

Union:

Taxes:

Net:

#include

using namespace std;

main()

{

string company, fname, initial, lname, id;

float hours, rph, gross, unionFee, taxes, net;

cout << "Enter compnay : ";

getline(cin, company);

cout << "Enter first name : ";

cin >> fname;

cout << "Enter middle inital : ";

cin >> initial;

cout << "Enter last name : ";

cin >> lname;

cout << "Enter id : ";

cin >> id;

cout << "Enter hours worked : ";

cin >> hours;

cout << "Enter rate per hours : ";

cin >> rph;

if (hours <= 40)

gross = hours * rph;

else

gross = (40 * rph) + (hours - 40) * (rph * 1.5);

unionFee = gross * .07;

taxes = gross * .15;

net = gross - unionFee - taxes;

cout << "Company: " << company << endl;

cout << "Firs name:" << fname << endl;

cout << "Middle initial :" << initial << endl;

cout << "Last name :" << lname << endl;

cout << "ID:" << id << endl;

cout << "Hours worked :" << hours << endl;

cout << "Rate per hour :" << rph << endl;

cout << "Gross :" << gross << endl;

cout << "Union:" << unionFee << endl;

cout << "Taxes:" << taxes << endl;

cout << "Net: " << net << endl;

} // main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago