Question

In: Computer Science

IN C# Create classes: Person, Student, Employee, Professor, Staff and Address ☐ Address class must have...

IN C#

Create classes: Person, Student, Employee, Professor, Staff and Address

  1. ☐ Address class must have suitable auto-implemented properties for Address 1, Address 2 and City.
  2. ☐ Person class must have suitable auto-implemented properties for Name, Residence (type Address) and email.
  3. ☐ Student and Employee must be subclasses of Person.
  4. ☐ Employee must be a super class for Professor and Staff.
  5. ☐ Employee class must have suitable auto-implemented properties for salary (between 2000 to 8000), and hire date.
  6. ☐ Professor class must have suitable auto-implemented properties for office hours and rank (use enum, e.g. Assist. Prof., Assoc. Prof., etc.)
  7. ☐ Staff class must have auto-implemented property for a designation (use enum, e.g. Office Assistance, Clerk, etc.)
  8. ☐ All classes must have suitable constructor(s) and making use of super class constructors as applicable.
  9. ☐ Override the ToString method in each class to return the class name and all other information in one/single line (use string interpolation and use base class ToString as applicable)

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.

Solutions

Expert Solution

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();
      }
   }

}


Related Solutions

In C# Create classes: Person, Student, Employee, Professor, Staff and Address ☐ Address class must have...
In C# Create classes: Person, Student, Employee, Professor, Staff and Address ☐ Address class must have suitable auto-implemented properties for Address 1, Address 2 and City. ☐ Person class must have suitable auto-implemented properties for Name, Residence (type Address) and email. ☐ Student and Employee must be subclasses of Person. ☐ Employee must be a super class for Professor and Staff. ☐ Employee class must have suitable auto-implemented properties for salary (between 2000 to 8000), and hire date. ☐ Professor...
I have tables student, professor, and person. The relationship between student and person, and professor and...
I have tables student, professor, and person. The relationship between student and person, and professor and person is Is A inheritance. A person may be a student but not a professor, a professor but not a student, or neither a professor or a student. How do I write a trigger in SQL that forces the constraint that a person cannot be a student and a professor. Some extra info: I have defined ID to be PK of person. ID is...
JAVA Design a class named Person and its two derived classes named Student and Employee. Make...
JAVA Design a class named Person and its two derived classes named Student and Employee. Make Faculty and Staff derived classes of Employee. A person has a name, address, phone number, and e-mail address. A student has a class status (freshman, sophomore, junior, or senior). An employee has an office, salary, and datehired. Define a class named MyDate that contains the fields year, month, and day. A faculty member has office hours and a rank. A staff member has a...
C++ HW Aim of the assignment is to write classes. Create a class called Student. This...
C++ HW Aim of the assignment is to write classes. Create a class called Student. This class should contain information of a single student. last name, first name, credits, gpa, date of birth, matriculation date, ** you need accessor and mutator functions. You need a constructor that initializes a student by accepting all parameters. You need a default constructor that initializes everything to default values. write the entire program.
Write in C++ language. (Employee Record): Create a class named 'Staff' having the following members: Data...
Write in C++ language. (Employee Record): Create a class named 'Staff' having the following members: Data members - Id – Name - Phone number – Address - AgeIt also has a function named 'printSalary' which prints the salary of the staff.Two classes 'Employee' and 'Officer' inherits the 'Staff' class. The 'Employee' and 'Officer' classes have data members 'Top Skill' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a officer by making an...
If a professor had an Indian student in class and the student asked the professor to...
If a professor had an Indian student in class and the student asked the professor to not pass out handouts with his left hand, do you think the professor should comply?
Must be in C#: 7. E-MAIL ADDRESS BOOK Create a Windows Forms Application with a class...
Must be in C#: 7. E-MAIL ADDRESS BOOK Create a Windows Forms Application with a class named PersonEntry. The PersonEntry class should have properties for a person’s name, e-mail address, and phone number. Also, create a text file that contains the names, e-mail addresses, and phone numbers for at least five people. When the application starts, it should read the data from the file and create a PersonEntry object for each person’s data. The PersonEntry objects should be added to...
C++ Classes & Objects Create a class named Student that has three private member: string firstName...
C++ Classes & Objects Create a class named Student that has three private member: string firstName string lastName int studentID Write the required mutator and accessor methods/functions (get/set methods) to display or modify the objects. In the 'main' function do the following (1) Create a student object "student1". (2) Use set methods to assign StudentID: 6337130 firstName: Sandy lastName: Santos (3) Display the students detail using get functions in standard output using cout: Sandy Santos 6337130
Language C++ Student-Report Card Generator: create a class called student and class called course. student class...
Language C++ Student-Report Card Generator: create a class called student and class called course. student class this class should contain the following private data types: - name (string) - id number (string) - email (s) - phone number (string) - number of courses (int) - a dynamic array of course objects. the user will specify how many courses are there in the array. the following are public members of the student class: - default constructor (in this constructor, prompt the...
C++ * Program 2:      Create a date class and Person Class.   Compose the date class...
C++ * Program 2:      Create a date class and Person Class.   Compose the date class in the person class.    First, Create a date class.    Which has integer month, day and year    Each with getters and setters. Be sure that you validate the getter function inputs:     2 digit months - validate 1-12 for month     2 digit day - 1-3? max for day - be sure the min-max number of days is validate for specific month...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT