Time is given as a 4 digit string. First 2 digits represent hour, the last 2 represent minitute.
Thus 935 is 9 hours 35 minutes (9:35am), 1454 is 14 hours 54 minutes (2:54pm).
• Write a method that prints time in hours and minutes (0-23 hours) without using decision logic.
• Expend the previous method to print time with am/pm distinction-allowed to use if/else to differentiate between am and pm.


LinkBack URL
About LinkBacks
Reply With Quote
It says 4 digit string so I thought about parse to convert to int but I really have no idea how to begin.... Any help or guidance would be really appreciated thanks