Question
use visual studio, this is the step how to creat the project.
creat new project in the next page make sure to select visual C++ then empty project on the next dialog box. after you create new project click on add new item and then select C++ source file (cpp file) and click add.
after you finish, make sure you send me the run file ( result) as well
Write a program that calculates and prints the amount of wages due to an employee for a weeks work. The program starts by as
1 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE IN C++:

#include <iostream>

using namespace std;

int main()
{
//taking number of hours as input from the user
int normalHours;
cout<<"Enter hours worked for the week:";
cin >> normalHours;
//taking hourlyRate as input from the user
double hourlyRate ;
cout << "Enter hourly rate:";
cin >> hourlyRate;
//taking holidayHours as input from the user
int holidayHours;
cout<<"How many of these were on a holiday:";
cin>>holidayHours;
//asking the whether birthday is there in this week or not
char ch;
cout<<"Did the employee have the birthday in the week[y/n]:";
cin>>ch;
//calculating totalWage
double totalWage = 0.0;
totalWage += holidayHours * hourlyRate * 2 ;
if(normalHours>60){
totalWage += (normalHours-60)*hourlyRate*2 + (20 * hourlyRate * 1.5) + (40-holidayHours)*hourlyRate;
}
else if(normalHours>40){
totalWage += (normalHours-40)*hourlyRate*1.5 + (40-holidayHours)*hourlyRate;
}
else
totalWage += (normalHours-holidayHours)*hourlyRate;
  
if(ch=='y'||ch=='Y')
totalWage += (totalWage*0.07);
//displaying the result
cout<<"Wages due for the week:$"<<totalWage<<endl;
return 0;
}
OUTPUT:

input Enter hours worked for the week:45 Enter hourly rate:10 How many of these were on a holiday:5 Did the employee have the

Add a comment
Know the answer?
Add Answer to:
use visual studio, this is the step how to creat the project. creat new project in...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C# visual studio This project tests your skills at building an Object-Oriented Programming project. The purpose...

    C# visual studio This project tests your skills at building an Object-Oriented Programming project. The purpose is to calculate pay for various types of employees. Use your same file for your [Your Name] Review.cs that contains your 2D Shape classes. Submit only your [Your Name] Review.cs file. The classes will contain: Employee Abstract class with the following properties: EmployeeId int FirstName string LastName string Pay (abstract, read only) double Sales Concrete class inherits Employee. Contains the following properties: Draw double...

  • Exercise 10.2. During one week, four production employees of Martinez Manufacturing Company worked the hours shown...

    Exercise 10.2. During one week, four production employees of Martinez Manufacturing Company worked the hours shown below. All these employees receive overtime pay at one and one-half times their regular hourly rate for any hours worked beyond 40 in a week. Determine the regular earnings, overtime earning, and gross earning for each employee. Employee No. Hourly Rate Hours Worked 1 $11.00 46 2 $10.62 47 3 $10.46 38 4 $10.80 48

  • An employee whose regular hourly rate is $10 and whose overtime rate is 1.5 times the...

    An employee whose regular hourly rate is $10 and whose overtime rate is 1.5 times the regular rate worked 44 hours in one week. In the payroll register, the employer should record wages expense of

  • Develop a WPF application that has a button to calculate an employee’s weekly pay, given the...

    Develop a WPF application that has a button to calculate an employee’s weekly pay, given the number of hours worked. An employee should have a first name, last name, age, and hourly consulting rate. You should be able to create an employee object and provide the hours worked to calculate the weekly pay. The application assumes a standard workweek of 40 hours. Any hours worked over 40 hours in a week are considered overtime and earn time and a half....

  • Create a dual-alternative selection structure using Python: A company ABC asked you to design a simple...

    Create a dual-alternative selection structure using Python: A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overtime wages. If employees work over 40 hours in a week, they will get 1.5 times of their regular hourly rate for all hours over 40. Your program asks the user to input hours worked for a week, regular hourly rate, and then display the weekly gross pay Output sample Enter weekly hours...

  • Question 2: Lynette Camacho earns $850/week. During a recent week she worked 45 hours. Assuming that...

    Question 2: Lynette Camacho earns $850/week. During a recent week she worked 45 hours. Assuming that Lynette's employer compensates her for overt hours at 1.5 times her regular pay rate, her gross earnings for the week are $ Question 14: Based on the Personal Allowances Worksheet, how many federal allowances would be claimed by a single employee with one job and no dependents, who files as single on his tax return, and who claims no credits on his tax returns?...

  • can someone help me with these question please. Question 2: Lynette Camacho earns $850/week. During a...

    can someone help me with these question please. Question 2: Lynette Camacho earns $850/week. During a recent week she worked 45 hours. Assuming that Lynette's employer compensates her for overtime hours at 1.5 times her regular pay rate, her gross earnings for the week are $ Question 7: An employee who earns $14/hour, worked 33 hours during a recent week, is paid a commission of $55 for each sale, and makes 10 sales during the same week, has earned total...

  • An employee whose regular hourly rate is $20 and whose overtime rate is 1.5 times the...

    An employee whose regular hourly rate is $20 and whose overtime rate is 1.5 times the regular rate worked 44 hours in one week. In the payroll register, the employer should record an overtime premium of

  • Visual C# C# Visual Studio 2017 You are to create a class object called “Employee” which included eight private variable...

    Visual C# C# Visual Studio 2017 You are to create a class object called “Employee” which included eight private variables - firstN - lastN - idNum -wage: holds how much the person makes per hour -weekHrsWkd: holds how many total hours the person worked each week. - regHrsAmt: initialize to a fixed amount of 40 using constructor. - regPay - otPay After going over the regular hours, the employee gets 1.5x the wage for each additional hour worked. Methods: -...

  • Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The fo...

    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,710 per week $34 per hour $50 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $910 $252 $500 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week. For the current pay...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT