compute a weekly salary

January 6, 2010 at 23:47:01
Specs: Windows XP
a program that compute a weekly salary for an hourly paid employee assume that the employer pays a regular hourly rate of 30.00. the overtime rate is 40.00 the first 40hours are paid using the regular rate of the total hours worked is more than 55 hours a hazard pay worth 280.00 is added

See More: compute a weekly salary

January 7, 2010 at 01:22:28
Not another homework question, surely not.

You don't even say which language you are using. I did an exercise like this 23 years ago but that was using MS-DOS BASIC but I doubt very much if that is what you are using.

Make an attempt, if you get stuck some will help you but no one is going to do your homework for you. Fathers do that for sons and thats your lot, everyone else pays.


Report •

January 8, 2010 at 15:12:16
This is hardly a networking question.


Report •

January 8, 2010 at 17:01:24
#include <iostream.h>

const float hourly_rate =30.00;//declare variables
const float overtime_rate= 40.00;
const float hazard_pay = 280.00;
float grosspay =0.00;
char ans;
int hours = 0;
int overtime_hours = 0;

void main()
do //start loop
cout<<"\t enter hours worked \n";
cin>> hours;//get time

if(hours <= 40)//standard 40 hr or less week
grosspay= ( hours * hourly_rate);//compute pay if 40 hours or less
if(hours>40)&&(hours<=55)// some overtime
overtime_hours= (hours - 40);
grosspay = (hourly_rate * 40) + (overtime_hours * overtime_rate);
overtime_hours= (hours - 40);
grosspay = (40 * hourly_rate) + (overtime_hours * overtime_rate) + 280.00
cout<<"\t\t The grosspay of this worker is $ "<<grosspay;

cout<< "\tdo you want to enter another workers hours ? Y or N ";
cin>> ans;
while( ans ==Y)||(ans==y);

This has not been compiled but it's a basic idea in C++
have fun

Report •
Related Solutions

Ask Question