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 taking a user input 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

☐ To list, add, update and delete to a list one must use LINQ.

Solutions

Expert Solution

using System;
namespace A {
   class Student {
      private string code = "Not Applicable";
      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() {
     
         // Creating a new Student object:
         Student s = new Student();
        
         // Setting code, name and the age of the student
         s.Code = "001";
         s.Name = "Abcd";
         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

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...
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...
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
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...
Create two child classes, UnderGraduateStudent and GraduateStudent that will extend from the Student class. Override the...
Create two child classes, UnderGraduateStudent and GraduateStudent that will extend from the Student class. Override the char getLetterGrade() method in each of the child classes. Use Student.java class defined below: (complete and compile) class Student {    private int id;    private int midtermExam;    private int finalExam;    public double calcAvg() {       double avg;       avg = (midtermExam + finalExam) / 2.0;       return avg;    }    public char getLetterGrade() {       char letterGrade = ‘ ‘;...
Write a C++ program to allow the user to: 1. Create two classes. Employee and Departments....
Write a C++ program to allow the user to: 1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeID, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays . One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to do the following: 1....
(JAVA) Create three classes, Vehicle, Truck, and Person. The Vehicle class has a make and model,...
(JAVA) Create three classes, Vehicle, Truck, and Person. The Vehicle class has a make and model, test emissions per mile, and a driver/owner (= Person object). (Each vehicle can only have one driver/owner.) The class Truck is a derived class from the Vehicle class and has additional properties load capacity in tons (type double since it can contain a fractional part) and a towing capacity in pounds (type int). Be sure that your classes have appropriate constructors, accessors, mutators, equals(),...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all of the methods required for a standard user defined class: constructors, accessors, mutators, toString, equals Create the client for testing the Student class Create another class called CourseSection Include instance variables for: course name, days and times course meets (String), description of course, student a, student b, student c (all of type Student) Create all of the methods required for a standard user defined...
Using Classes This problem relates to the pre-loaded class Person. Using the Person class, write a...
Using Classes This problem relates to the pre-loaded class Person. Using the Person class, write a function print_friend_info(person) which accepts a single argument, of type Person, and: prints out their name prints out their age if the person has any friends, prints 'Friends with {name}' Write a function create_fry() which returns a Person instance representing Fry. Fry is 25 and his full name is 'Philip J. Fry' Write a function make_friends(person_one, person_two) which sets each argument as the friend of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT