In: Computer Science
IN C#
Create classes: Person, Student, Employee, Professor, Staff and Address
In the Main Method, create three Lists for (Student, Staff, and Professor) with hard-coded data for at least 4 entries each.
Implement the menu driven CONSOLE logic as:
Press 1 to modify Student
Press 2 to modify Staff
Press 3 to modify Professor
Press 0 to exit program
☐modify Student Menu Press 1 to list all students Press 2 to add a new student Press 3 to update … Press 4 to delete … Press 5 to return to main menu |
☐ modify Staff Menu Press 1 to list all Staff Press 2 to add a new Staff Press 3 to update … Press 4 to delete … Press 5 to return to main menu |
☐modify Professor Menu Press 1 to list all Professors Press 2 to add a new Professor Press 3 to update … Press 4 to delete … Press 5 to return to main menu |
☐ Console application must have a hierarchy of above-shown menus and run continuously until the person quits the application
☐ For Search (required to find and update) must use LINQ.
using System; namespace tutorialspoint { class Student { private string code = "N.A"; private string name = "not known"; private int age = 0; // Declare a Code property of type string: public string Code { get { return code; } set { code = value; } } // Declare a Name property of type string: public string Name { get { return name; } set { name = value; } } // Declare a Age property of type int: public int Age { get { return age; } set { age = value; } } public override string ToString() { return "Code = " + Code +", Name = " + Name + ", Age = " + Age; } } class ExampleDemo { public static void Main() { // Create a new Student object: Student s = new Student(); // Setting code, name and the age of the student s.Code = "001"; s.Name = "Zara"; s.Age = 9; Console.WriteLine("Student Info: {0}", s); //let us increase age s.Age += 1; Console.WriteLine("Student Info: {0}", s); Console.ReadKey(); } }
}