Beispiel #1
0
 public int GetAgeYears(Student st)
 {
     int age;
     DateTime dtnow = DateTime.Now;
     DateTime dtbth = new DateTime(st.berthYear, st.berthMonth, st.berthDay);
     TimeSpan ts = dtnow - dtbth;
     age = Convert.ToInt32(ts.TotalDays) / 365;
     return age;
 }
Beispiel #2
0
 public string GetFullName(Student st)
 {
     string full_name = String.Format("{0,15} {1,15} {2,15}", st.firstName, st.middleName, st.lastName);
     return full_name;
 }