C 1Teacher class Inherit from your base class Fields Status

C#

1.Teacher class

Inherit from your base class.

Fields:

Status - enum (Employeed, Retired, Inactive)

EmployementType - enum (Part Time, Full Time, Tenured)

---

Properties

Add properties for the fields above

---

Methods

Constructor that takes an id and name and sets the base fields.

Override the Print method to print id, name, status, and type

---

Main

Create a teacher object.

Use the set/get on ID & Name, Status & EmploymentType as they already exist.

Call the Print method.

C#

2.

School Class

Create a school class with the following specs:

Fields

-Staff - Teacher[] (or list, etc)

-Students - Student[] (or list, etc)

---

Properties

Student Count - gets the count of students

Staff Count - gets the count of teachers that are   teaching.

---

Methods

Add(base) - Takes a teacher/student object and adds it to the appropriate collection.

Print(base[]) - Private method that takes an array of your base class object and prints all the elements of the array.

Print(bool students = true) - Public method that prints out the list of students, or list of teachers based upon the parameter value. This is done by calling the Print(base[]) with the student[] or teacher[] based upon the bool.

---

Main

Create a school object.

Create several student objects and add them to the school.

Create several teacher objects and add them to the school.

Call yourschool.Print with no argument and again with false.

Solution

using System;
namespace November24
{
class Teacher : Person
{
private string subject;
   Status enum (Employeed, Retired, Inactive)
   EmployementType enum (Part Time, Full Time, Tenured)

   Techer myTeacher = new Teacher();
  
   myTeacher.SetId(0022);
   myTecher.SetName(Raj);
   myTeacher.SetStatus(Employeed);
   myTecher.SetEmployementType(Full Time);
  
   public void Explain()
{
Console.WriteLine(\"Explanation begins\");
}
}
}


using System;
namespace November24
{
class Student
{
static void Main()
{
public static int count = 0;
   
       Public Student () {
           Interlocked.Increment(ref count);
       }
  
Student myStudent = new Student();
myStudent.SetAge(21);
  
}
}
}

C# 1.Teacher class Inherit from your base class. Fields: Status - enum (Employeed, Retired, Inactive) EmployementType - enum (Part Time, Full Time, Tenured) ---
C# 1.Teacher class Inherit from your base class. Fields: Status - enum (Employeed, Retired, Inactive) EmployementType - enum (Part Time, Full Time, Tenured) ---

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site