using System.Collections.Generic;
using System.Collections.ObjectModel;
public static void Main(String[] args)
var ram= new Student("Ram","Krishnan",20);
var srini=new Student("Srini","Patteri",21);
var preeti=new Student("Preeti","Roy",20);
var rina=new Teacher("Rena","Nair",32);
var ccourse=new Course("Programming with C#")
students=new Collection<Student>{ram,srini,preeti},
teachers=new Collection<Teacher>{rina}
var ddegree=new Degree("Bachelor")
var uProgram=new UProgram("Information Technology")
Console.WriteLine(uProgram);
Console.WriteLine(ddegree);
int ccount=Student.Count();
Console.WriteLine("{0} students are currently enrolled",ccount);
public string Name{get;private set;}
public Degree degree{get;set;}
public UProgram(String name)
public override string ToString()
return "The "+ Name+ " degree contains the course "+ degree.Name;
public string Name{get;private set;}
public Course course{get;set;}
public Degree(string name)
public override string ToString()
return "The "+ Name+ " degree contains the course "+ course.Name;
public string Name{get; private set;}
public IEnumerable<Student> students{get;set;}
public IEnumerable<Teacher> teachers{get;set;}
public Course(string name)
public string FirstName{get;set;}
public string LastName{get;set;}
public int Age {get;set;}
public static int count=0;
public Student(string first,string last,int age)
public static int Count()
public string FirstName{get;set;}
public string LastName{get;set;}
public int Age {get;set;}
public Teacher(string first,string last,int age)