static void Main(string[] args) { try { ExDate date1 = new ExDate(30, 11, 20); ExDate date2 = new ExDate(18, 6, 34); ExDate date3 = new ExDate(10, 10, 10); ExDate date4 = new ExDate(1, 1, 2); StudentCard stcard1 = new StudentCard(3, date1, Status.locked); StudentCard stcard2 = new StudentCard(1000, date2, Status.unloced); StudentCard stcard3 = new StudentCard(48, date3, Status.unloced); StudentCard stcard4 = new StudentCard(10, date4, Status.locked); Console.WriteLine(stcard1.ToString()); Console.WriteLine(stcard2.ToString()); Console.WriteLine(stcard3.ToString()); Console.WriteLine(stcard4.ToString()); } catch (Error err) { Console.WriteLine(err.Message); } catch (Error2 err) { Console.WriteLine(err.Message); } catch (Error3 err) { Console.WriteLine(err.Message); } }
public StudentCard(int balance, ExDate date, Status st) { this.balance = balance; this.date = date; this.st = st; }