That's not really hard if I understand your (rather vague) requirements correctly.
- take in a number
- if it's bigger then 40: subtract 40 and store the rest
- multiply the rest with 1,5 and add to 40
- multiply the outcome with hourly rate
- done
[edit]
ps. One free piece advice: Stop using the conio.h header. It's outdated and was never standard c++ to start with. I know you think you
need it for getch, but if you replace
getch() with:
You'll have the same result in standard C++
Last edited by Nick Evan; Nov 13th, 2008 at 8:49 am.
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Offline 4,132 posts
since Oct 2006