From: James Edward Gray II Date: 2007-08-31T21:48:36+09:00 Subject: Re: Program which calculates earnings (with some difficulties).. On Aug 31, 2007, at 7:08 AM, Joop Van den tillaart wrote: > I have a 'problem' which I cannot solve using spreadsheet software > like > Excel. Neat problem. Are you wanting us to solve it for you, or help you solve it? I'll hope it's the latter and try doing that. The biggest secret to programming is to work in small slices. Break the problem down as much as you can and then just keep adding bit by bit until you reach the goal. So, I'm thinking these are some good steps to work in: 1. Write a program that accepts a start and end time from you and just prints them to the screen. You could possibly take these in as command-line arguments or you could prompt the user for input. 2. Modify your program to print the total number of hours between the entered start and end time. This is a little trickier than simple subtraction, since you could start working on one day and end on a different day. 3. Modify your program to divide this total hour count down into the various shifts. So instead of telling you that you worked five hours, it would tell you that you worked four night shift hours and one morning shift hour. 4. Modify your program to remove the half hour breaks as they occur. Make sure this drops out of the proper shift hours, so the pay will be adjusted correctly. 5. Modify your program to print money earned, instead of hours. This step is now just simple math. Hope that helps. Please do ask us for ideas when you get stuck! James Edward Gray II