Calculating payment from hours worked input

Started by
8 comments, last by CrackMEup 23 years, 2 months ago
how would i make a program that does this -input a series of 2 times .. (3:45pm-7:36am , 4:23pm-11:43pm , etc.) -it totals up the times and calculates the amount of hours worked -asks for a hourly rate -figures the amount to be paid (takes # of hr's * hourly rate) EDIT: try using sensible, descriptive titles, and if the letters look like you're yelling, hit capslock an odd number of times when entering them. -fel Edited by - felisandria on February 19, 2001 11:07:14 AM
Advertisement
Well, get hold of a programming language first, learn it, then write a program to do what you want.
If you get stuck on any of this then you can come back here and post a question with a SENSIBLE title so people have a reference as to what the question is about.
Gee Brain, what we gonna do tonight?
well i know very little C++
You''ve already got the program''s structure/flow sorted out there, you just to learn the basics of C to write it. Just find any C book and read it.

If you really can''t be bothered:
iostream.h:
cout << "hello"; //outputs text/numbers
cin >> var; //inputs text/numbers

the rest is simple maths, you''ve practically spelt it out in your question.
do your homework yourself.
Yeah, don''t ask how to write the program, learn the language and write it for yourslef, or atleast attempt to, we learn by doing things ourselves, not by other people telling us exactly how to do it, now if you have tried a lot of different ways to write the program and just can''t get it tow work that''s different, but don''t ask how to do something, most people here were self taught, at least that''s what i have gathered from reading other posts, anyway, get a good book and read and learn. And yes the solution is fairly simple, just basic math calculations.
I tried , and my friend tried .. we cant get it ..
err , i should have said this .. the only part we cant get is the how to measure the time .. We can do everything but calculating the number of hours from the times given
You could just use 24hr clock times but that wouldn''t work if you worked ridiculous hours, e.g 7pm til 3am. just minus the first time from the second time in 24hour. ask for the input in three sections-hours,minutes and seconds(if that matters to you).
you would have to do an if statement for timeAhrs < 23&& timeAmins < 59
{ IF //nested if statement
timeBhrs > 0 && timeBhrs < timeAhrs
{
work out some math
}
This maybe a load of crap but try it. I am knackered and don''t really care if it is wrong, but I have tried muy best to think of something that works.
***We were all beginners once, don't forget that...***
So you mean to say that, given your dinner is going to be at 6pm, and it is now 11:15am, you can''t work out how long it will be until dinner time?

I suggest you get out a piece of paper and a pencil and work it out.
Gee Brain, what we gonna do tonight?

This topic is closed to new replies.

Advertisement