zh_stoqnov

Exam Schedule

Oct 28th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Globalization;
  7.  
  8. namespace ExamSchedule
  9. {
  10. class ExamSchedule
  11. {
  12. static void Main(string[] args)
  13. {
  14. string startHour = Console.ReadLine();
  15. string startMinute = Console.ReadLine();
  16. string partOfDay = Console.ReadLine();
  17.  
  18. int examhours = int.Parse(Console.ReadLine());
  19. int examMinutes = int.Parse(Console.ReadLine());
  20. CultureInfo culture = CultureInfo.GetCultureInfo("en-US");
  21. string timeExamStart = startHour + ":" + startMinute + " " + partOfDay;
  22. DateTime startTime = Convert.ToDateTime(timeExamStart, culture);
  23. DateTime endHours = startTime.AddHours(examhours);
  24. DateTime endTime = endHours.AddMinutes(examMinutes);
  25. Console.WriteLine(endTime.ToString("hh:mm:tt", culture));
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment