public static void Main(string[] args) { try { Student student = Student.GetStudentInformation(); student.PrintStudentInformation(); Student.ValidatingStudentBirthday(); } catch (NotImplementedException ex) { Console.WriteLine(ex.Message); } catch (FormatException e) { Console.WriteLine("The data you entered is incorrect format"); } Teacher teacher = Teacher.GetTeacherInformation(); teacher.PrintTeacherInformation(); Uprogram uprogram = Uprogram.GetUprogramInformation(); uprogram.PrintUprogramInformation(); DegreeInfo degree = DegreeInfo.GetDegreeInformation(); degree.PrintDegreeInformation(); CourseInfo course = CourseInfo.GetCourseInformation(); course.PrintCourseInformation(); }
public static CourseInfo GetCourseInformation() { Console.WriteLine("Enter courseName"); string courseName = Console.ReadLine(); Console.WriteLine("Enter credits"); int credits = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter durationInWeeks"); int durationInWeeks = Int32.Parse(Console.ReadLine()); Console.WriteLine("Enter teacher"); string teacher = Console.ReadLine(); CourseInfo course = new CourseInfo(courseName, credits, durationInWeeks, teacher); return(course); }