View Full Version: Need Help with Time.

C++ Learning Community > C++ Works in Progress > Need Help with Time.


Title: Need Help with Time.


gong - December 25, 2006 03:14 AM (GMT)
Write a menu-driven program that repeatedly allows the user to select one of the following tasks:

(Task 1) User enters the time of city A, time difference between cities A and B, and the program will output the equivalent time of city B.



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 how to start. My C++ not so good.. Thanks.




Hosted for free by InvisionFree