public static void Main() { Student payingStudent = new Student(); ScholarshipStudent freeStudent = new ScholarshipStudent(); Employee clerk = new Employee(); Console.Write("Using Student: "); DisplayObjectMessage(payingStudent); Console.Write("Using ScholarshipStudent: "); DisplayObjectMessage(freeStudent); Console.Write("Using Employee: "); DisplayObjectMessage(clerk); }
static void Main() { Student payingStudent = new Student(); ScholarshipStudent freeStudent = new ScholarshipStudent(); Employee clerk = new Employee(); Write("Using Student: "); DisplayObjectMessage(payingStudent); Write("Using ScholarshipStudent: "); DisplayObjectMessage(freeStudent); Write("Using Employee: "); DisplayObjectMessage(clerk); }
public static void Main() { Student payingStudent = new Student(); ScholarshipStudent freeStudent = new ScholarshipStudent(); payingStudent.Name = "Megan"; payingStudent.Credits = 15; freeStudent.Name = "Luke"; freeStudent.Credits = 15; Console.WriteLine("{0}'s tuition is {1}", payingStudent.Name, payingStudent.Tuition.ToString("C")); Console.WriteLine("{0}'s tuition is {1}", freeStudent.Name, freeStudent.Tuition.ToString("C")); }
static void Main() { Student payingStudent = new Student(); ScholarshipStudent freeStudent = new ScholarshipStudent(); payingStudent.Name = "Megan"; payingStudent.Credits = 15; freeStudent.Name = "Luke"; freeStudent.Credits = 15; WriteLine("{0}'s tuition for {1} credits is {2}", payingStudent.Name, payingStudent.Credits, payingStudent.Tuition.ToString("C")); WriteLine("{0}'s tuition for {1} credits is {2}", freeStudent.Name, freeStudent.Credits, freeStudent.Tuition.ToString("C")); }