C# question
im trying to write a example program which calculates an employees wage. basically they input the hrs worked and the users pay rate. the output calculates the wage but i need it so that if the employee works over 40 hrs then any hours ov over the 40 mark are paid at double rate.
i cant seem to figure it out(im new to this programming stuff!)
could anyone help?
i cant seem to figure it out(im new to this programming stuff!)
could anyone help?
Xbox Live: Bring It On
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking
Comments
-
dtlokee Member Posts: 2,378 ■■■■□□□□□□float hours, wage, rate;
if (hours > 40)
{
wage = ((hours - 40) * (rate * 2) + (40 * rate);
}
else
{
wage = hours * rate;
}
or somthing like that.The only easy day was yesterday! -
nel Member Posts: 2,859 ■□□□□□□□□□thanks mate your a star, i was so close but didnt have my maths in the right placesXbox Live: Bring It On
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking -
dtlokee Member Posts: 2,378 ■■■■□□□□□□I have been drinking heavily today, you may end up overpaying your employesThe only easy day was yesterday!
-
nel Member Posts: 2,859 ■□□□□□□□□□haha ....if only that would happen to all of usXbox Live: Bring It On
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking