Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
QBasic Time clock programming
Name: Matt Date: January 25, 2002 at 20:18:09 Pacific
Comment:
I have been given an assignment by my school to create a program where users clock in and clock out. Right now, the system just records the time and date that they punched in/out and I need a way of determining the length of time that they worked. Any examples would be very much appreciated as it is due very very soon.
Name: James Date: January 27, 2002 at 01:31:27 Pacific
Reply:
I'm not sure if I'm reading you correctly but if I am this is what you need to do: (this method is inefficient but simple)
Convert the year month and day to days past 2002 for both dayin and dayout. Get the difference (DIFF1) in these values which gives you the days that the user was logged in. eg. IN: 5/2/2002 OUT: 5/3/2002 5 (day 5) + 31 (january) + 0 (2002) 5 (day 5) + 31+28 (january+february)+0(2002) DIFF1 = 28 days
There are many other ways that are more efficient to do the day difference but that would require a bit more complicated math.
Then if the time is recorded in seconds past midnight (don't remember how Qbasic records time) Get the difference between these (DIFF2).
Therefore the user was logged in for DIFF1 days and DIFF2 seconds.
Summary: I'm trying to write an time alarm program for windows in C++. The problem I've programmed in windows with JAVA but I'm new wit C++ in windows. I could use mingw or visual C++. I want my program to wai...
Summary: what function can i use for asking if a key was pressed except kbhit() ? my program looks like this: up:main program . . do{ time clk display routine{ . time stucture option select . }while(!kbhit())(...