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
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
ADVERTISEMENT