Question

create a program using a vector that stores in two vectors:the hours worked by 3 employees...

create a program using a vector that stores in two vectors:the hours worked by 3 employees and their hourly pay rates.

Homework Answers

Answer #1

void main (void)

{

vector<int> hours(3);

vector<float>payrate(3);

cout<< "enter the hours worked by 3 employees\n";

cout << "and their hourly rates\n";

for ( int i=0;i<3;i++)

{

cout <<"hours worked by employee #" << ( i+1);

cout << ":";

cin >> hours[i];

cout << "hourly payrates for employee #";

cout << (i + 1) << ":";

cin >> payrate[i];

}

cout << "gross pay for each employee are as under: \n";

cout.precision(2);

cout.setf(ios::fixed | ios::showpoint );

for(int i=0;i<3;i++)

{

float grosspay= hours[i] * payrate[i];

cout << "employee #" << ( i+1);

cout << " : $" << grosspay << endl;

}

}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Python Coding Federal law requires that hourly employees be paid “time and a half” for all...
Python Coding Federal law requires that hourly employees be paid “time and a half” for all work above 40 hours per week. Write a program that prompts the user to enter their hours worked and hourly wage (e.g. $20.00/hr) and then computes and prints their pay. The program should test the number of hours worked to determine if any overtime pay is due. As an example for regular pay (no overtime) suppose that a worker makes $10/hr and works 40...
The following table stores details on employees and the projects they have worked on and the...
The following table stores details on employees and the projects they have worked on and the hours they spent on the project each week: WORKLOAD EmpID EmpName ProjID ProjName HoursPerWeek E01 Smith P02 Database 10 E02 Smith P01 Web Portal 5 E03 Robinson P02 Database 20 Question: Explain why the above table is not in 2nd normal form. Then normalise it to 2nd normal form. Once the table is in 2nd normal form, test if the result is in 3rd...
Zolnick Enterprises has two hourly employees: Kelly and Jon. Both employees earn overtime at the rate...
Zolnick Enterprises has two hourly employees: Kelly and Jon. Both employees earn overtime at the rate of 1.8 times the hourly rate for hours worked in excess of 42 per week. Assume the Social Security tax rate is 6 percent on the first $110,000 of wages, and the Medicare tax rate is 1.5 percent on all earnings. Federal income tax withheld for Kelly and Jon was $260 and $228, respectively. The following information is for the first week in January...
1) . Joe Wilkes earns $4,000 per month. He worked 22 hours of overtime this month....
1) . Joe Wilkes earns $4,000 per month. He worked 22 hours of overtime this month. Joe's gross salary for the month is a) . $6,031.25 b) . $4,230.37 c) . $4,761.64 d) . $7,115.15 2) . When an employee is in a profession that is customarily tipped a) . must deduct all tips from the gross salary. b) the employer may take a $5.12 credit towards the minimum wage under federal law. c) the employer may deduct all tips...
K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll...
K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: Consultant Computer Programmer Administrator Regular earnings rate $2,510 per week $28 per hour $50 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $920 $240 $495 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay period, the...
alculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The...
alculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: ConsultantComputer ProgrammerAdministrator Regular earnings rate$2,310 per week $32 per hour $50 per hour Overtime earnings rateNot applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld$910 $242 $510 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay period, the computer programmer worked...
K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll...
K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: Consultant Computer Programmer Administrator Regular earnings rate $2,910 per week $32 per hour $42 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $930 $249 $505 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay period, the...
Calculate Payroll K. Mello Company has three employees—a consultant, a computer programmer, and an administrator. The...
Calculate Payroll K. Mello Company has three employees—a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: Consultant Computer Programmer Administrator Regular earnings rate $4,000 per week $30 per hour $40 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $925.00 $248.00 $505.00 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay...
Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The...
Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: Consultant Computer Programmer Administrator Regular earnings rate $3,010 per week $30 per hour $44 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $910 $241 $495 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay...
Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The...
Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: Consultant Computer Programmer Administrator Regular earnings rate $2,310 per week $34 per hour $48 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $915 $255 $515 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay...