Advertisement
Guest User

Untitled

a guest
Jul 5th, 2014
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using System;
  2. using System.Threading;
  3.  
  4.  
  5. class ExamSchedule
  6. {
  7. static void Main()
  8. {
  9.  
  10. string startHours = Console.ReadLine();
  11. string startMinutes = Console.ReadLine();
  12. string startPartOfTheDay = Console.ReadLine();
  13. int durationHours = int.Parse(Console.ReadLine());
  14. int durationMinutes = int.Parse(Console.ReadLine());
  15.  
  16. DateTime startTime = DateTime.Parse(startHours + ":" + startMinutes + " " + startPartOfTheDay);
  17. startTime = startTime.AddHours(durationHours);
  18. startTime = startTime.AddMinutes(durationMinutes);
  19. Console.WriteLine("{0:hh:mm tt}",startTime);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement