Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

CrackMEup

Calculating payment from hours worked input

This topic is 6307 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
do your homework yourself.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!