![]() |
| | #1 |
| Registered User Join Date: Jun 2006
Posts: 8
| need help in time zone Define and implement a class Time. Time difference is a positive value if time of city B is ahead of city A. It is a negative value if time of city B is behind city A. Typical Sample Runs for Task 1 (user inputs in bold): Enter hrs, mins and am/pm of time of city A: 2 10 pm Enter time difference (in hrs) between cities A & B: 6 The equivalent time of city B is 8:10 pm. Enter hrs, mins and am/pm of time of city A: 9 45 am Enter time difference (in hrs) between cities A & B: -3 The equivalent time of city B is 6:45 am. Can someone help me or got any sample. My C++ not so good.. Thanks. |
| Gong is offline | |
| | #2 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,693
| Never mind the C++, do you understand the maths which is needed for this? Hint: Convert hh:mm into hh*60+mm Then perform the calculation. Then convert the result back into hh:mm |
| Salem is offline | |
| | #3 | |
| CSharpener Join Date: Oct 2006
Posts: 5,331
| Quote:
__________________ If I have eight hours for cutting wood, I spend six sharpening my axe. | |
| vart is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Representing floats with color? | DrSnuggles | C++ Programming | 113 | 12-30-2008 09:11 AM |
| Using pointers | Big_0_72 | C Programming | 3 | 10-28-2008 07:51 PM |
| calculating user time and time elapsed | Neildadon | C++ Programming | 0 | 02-10-2003 06:00 PM |
| Checking parts of a structure | DocDroopy | C Programming | 11 | 08-05-2002 07:45 AM |