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
Description Write a program that reads in the name, hourly rate and number of hours worked...
Description Write a program that reads in the name, hourly rate and number of hours worked for 5 people. Print the name of each person, the number of hours worked, their weekly pay based on the number of hours they worked and how much they owe in taxes. Assume that taxes take 20% of the paycheck. Don’t forget to take the taxes out of the pay check. If they work more than 40 hours they get overtime. The hourly rate...
Hourly workers are paid at their regular pay rate for their first 40 hours worked each...
Hourly workers are paid at their regular pay rate for their first 40 hours worked each week. Any hours beyond that are considered overtime, and they get paid "time-and-a-half" for those hours (1-1/2 times their regular pay rate). For example, if a worker normally makes $12.00 per hour and has worked 45 hours in the past week, the pay is computed as follows: 40 times $12 for the "regular" hours is $480. The extra 5 hours is overtime and is...
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...
Write a program in python that calculates the salary of employees. The program should prompt the...
Write a program in python that calculates the salary of employees. The program should prompt the user to enter hourly rate and number of hours of work a day. Then, the program should display the salary daily, bi-weekly (5 days a week), and monthly. Sample program: Enter your hourly rate: >>> 20 Enter how many hours you work a day: >>> 8 Your daily salary is: $160 Your bi-weekly salary is: $1600 Your monthly: $3200