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

PROJECT DESCRIPTION Cumberland Training Services ( CTS ) has commissioned your f

ID: 3837355 • Letter: P

Question

PROJECT DESCRIPTION

               

            Cumberland Training Services ( CTS ) has commissioned your firm to design and    develop             an application that can simulate their instruction policies, procedures and processes.

            Your programming team has been chosen for this task and they have suggested an            implementation of object - oriented programming with classes, objects and inheritance.

            Using the skeletal starter code provided write and test the program code that will accomplish any of the above tasks, in accordance to these class definitions and specifications.

            (i) Include a parent class named Instructors. This class will define all the typical

            instructor properties and actions such as teaching budgets, locations of training classes,       level of instructor knowledge, teaching materials, etc.

            (ii) Include a derived class named Spartans. This class will re - define an instructor to

            include special attributes and actions for this classification. An instructor of this class           type is one that has exhibited superior instructional style and is considered as the top     level that the firm possesses. Spartan class instructors will therefore be allocated a    greater dollar amount for their teaching budget and have precedence to instruct in the newer classrooms that the firm has just constructed.

            (iii) Include a derived class named Athenians. This class will re - define an instructor to

            include special attributes and actions for this classification. An instructor of this class           type is one that has exhibited excellent instructional style and is considered as almost at             the top level that the firm possesses. Athenian class instructors will be allocated a                  dollar amount for their teaching budget, which is to be a lessor amount than the Spartan             class. Athenian class instructors have secondary precedence to instructing in the newer      classrooms that the firm has just constructed. Their primary instructional location in the           firm’s building is within one of the older classrooms.

            (iv) Include a test class that can be used to instantiate objects of the above classes.

            These objects can be used to assign properties to instructors and to run any necessary

            actions.

Information About This Project

            Java inheritance assists programmers in using parent classes and then extending    their attributes and methods to child classes.

                       

Steps to Complete This Project

STEP 1             Open NetBeans or Eclipse  

                        Open NetBeans or Eclipse and create a Java project with the following details.

                        For Project Name include: Instructors

                        For the Main Class include Instructors

Within your Java application, create four classes using the skeletal code statements that follow.

PROJECT    Java Applications: Java Inheritance

Figure 1           Source Code for the Java Inheritance Program: Class Instructors

public class Instructors

{

      public Instructors() { }

}

     

Figure 2           Source Code for the Java Inheritance Program: Class Spartans

public class Spartans extends Instructors

{

      public Spartans() { }

}

     

Figure 3           Source Code for the Java Inheritance Program: Class Athenians

public class Athenians extends Instructors

{

      public Athenians() { }

}    

Figure 4           Source Code for the Java Inheritance Program: Test Class

public class TestClass
{

      public static void main(String[] args)

      {

            Instructors instruct = new Instructors();

            Spartans sparta = new Spartans();

      }

}    

STEP 2             Code Your Classes

    

                        Write program code for the parent class in your application. Include any data        members and methods that would match the specifications of this application, as         listed on the prior page.             

                        Then, write program code for the remaining classes that comprise this       application. Of course your test class will include the main() method.

Use your own imagination as to what data values or settings would best serve the instructions for this application.     

PROJECT    Java Applications: Java Inheritance

STEP 3             Build, Compile and Run the Program

    

From the Java Run menu select Run Project to run your app.

           Observe the program's output, which should satisfy the project’s specifications        and requirements.

public class Instructors

{

      public Instructors() { }

}

     

Explanation / Answer

This is super class  Instructors:

package com.InstructorsProject;

public class Instructors {

   private int teaching_budgets;
   private String locations_of_training_classes;
   private String level_of_instructor_knowledge;
   private String teaching_materials;
  
   //default constructor
   public Instructors() {
       super();
       // TODO Auto-generated constructor stub
   }
  
   //setters and getters
   public int getTeaching_budgets() {
       return teaching_budgets;
   }
   public void setTeaching_budgets(int teaching_budgets) {
       this.teaching_budgets = teaching_budgets;
   }
   public String getLocations_of_training_classes() {
       return locations_of_training_classes;
   }
   public void setLocations_of_training_classes(
           String locations_of_training_classes) {
       this.locations_of_training_classes = locations_of_training_classes;
   }
   public String getLevel_of_instructor_knowledge() {
       return level_of_instructor_knowledge;
   }
   public void setLevel_of_instructor_knowledge(
           String level_of_instructor_knowledge) {
       this.level_of_instructor_knowledge = level_of_instructor_knowledge;
   }
   public String getTeaching_materials() {
       return teaching_materials;
   }
   public void setTeaching_materials(String teaching_materials) {
       this.teaching_materials = teaching_materials;
   }

  
}

This is child class Spartans:

package com.InstructorsProject;

public class Spartans extends Instructors {

   //default constructor
   public Spartans() {
       super();
       // TODO Auto-generated constructor stub
   }

  
}

This is child class Athenians:

package com.InstructorsProject;

public class Athenians extends Instructors {

   //default constructor
   public Athenians() {
       super();
       // TODO Auto-generated constructor stub
   }

  
}

This is Driver class:

package com.InstructorsProject;

public class TestClass {

   public static void main(String[] args)
{
//Spartans child class
Spartans sparta = new Spartans();
sparta.setTeaching_budgets(5000);
sparta.setLocations_of_training_classes("new class room");
sparta.setLevel_of_instructor_knowledge("High");
sparta.setTeaching_materials("Available");
System.out.println("Spartans class properties");
System.out.println("Teaching budgets : "+sparta.getTeaching_budgets()+" $");
System.out.println("Locations of training classes : "+sparta.getLocations_of_training_classes());
System.out.println("Level of instructor knowledge : "+sparta.getLevel_of_instructor_knowledge());
System.out.println("Teaching materials : "+sparta.getTeaching_materials());
System.out.println("******************************************");
  
//Athenians child class
Athenians athenians = new Athenians();
athenians.setTeaching_budgets(3000);
athenians.setLocations_of_training_classes("Old class room");
athenians.setLevel_of_instructor_knowledge("Medium");
athenians.setTeaching_materials("Available");
System.out.println("Athenians class properties");
System.out.println("Teaching budgets : "+athenians.getTeaching_budgets()+" $");
System.out.println("Locations of training classes : "+athenians.getLocations_of_training_classes());
System.out.println("Level of instructor knowledge : "+athenians.getLevel_of_instructor_knowledge());
System.out.println("Teaching materials : "+athenians.getTeaching_materials());
  
  
}
}

Output:

Spartans class properties
Teaching budgets : 5000 $
Locations of training classes : new class room
Level of instructor knowledge : High
Teaching materials : Available
******************************************
Athenians class properties
Teaching budgets : 3000 $
Locations of training classes : Old class room
Level of instructor knowledge : Medium
Teaching materials : Available

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote