Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help me to write this program following the instructions below. ----------------

ID: 3558395 • Letter: H

Question

Help me to write this program following the instructions below.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Write a program with several classes, each containing several constructors and several methods, to accomplish the tasks given below.
- We want to design a hierarchy of classes and subclasses. The top-level class we design is called Student. This class is a template or recipe for creating instances of students, which are examples of objects.
Each instance of student has a first name, a last name, an age and an academic level.
Each student instance also has a social security number, a field which we would like to keep private so that it cannot be messed up by application programs. Please write a get and set method for this private instance field.
Declare a private class-level field to keep track of the number of student instances created. Provide get and set methods for the this variable.
Define at least one additional static variable for the Student class. Declare this property, and provide get and set methods for it.
- The Student class has three subclasses : CCStudent, UCCSStudent and CTechStudent, corresponding to Colorado College, University of Colorado at Colorado Springs and Colorado Technical University student, respectively. For each of these classes, create private static variable called Campus that stores the name of the campus, i.e., the university or the college. Provide a get and a set method for this variable.
- For each of the four classes, define three overloaded constructors. Remember, fields and methods are inherited by children, but constructors are not.
- For each of the classes, declare an instance with each constructor method. Then, print details of each instance with the appropriate toString method. This means that each of your classes must have a toString method defined. The method must be public and must returen a String. The Object class has a toString method, and the ones you write will override the toString methods of ancestor classes.
- Make sure each class definetion is stored in separate file. Use the main class to test that everything works.

Explanation / Answer

Program Code:


public class StudentDemo
{
   public static void main(String args[])
   {
       Student st=new Student();
      
   }
}
class Student
{
   String firstName, lastName,academicLevel;
   int age;
   private String ssn;
  
   Student()
   {
      
   }
   void set(String ssn)
   {
       this.ssn=ssn;
   }
   String get()
   {
       return ssn;
   }
   String toString(String x)
   {
       return x;
   }
  
}
class CCStudent extends Student
{
   private String campus;
  
   CCStudent()
   {
      
   }
   void set(String campus)
   {
       this.campus=campus;
   }
   String get()
   {
       return campus;
   }
}
class UCCStudent extends Student
{
   private String campus;
  
   UCCStudent()
   {
      
   }
   void set(String campus)
   {
       this.campus=campus;
   }
   String get()
   {
       return campus;
   }
}
class CTechStudent extends Student
{
   private String campus;
  
   CTechStudent()
   {
      
   }
   void set(String campus)
   {
       this.campus=campus;
   }
   String get()
   {
       return campus;
   }
}