Question
THE TRAININGBUS CLASS(15 marks) The TrainBus class is a specialized Bus. It stores private integer data items that represent teacherArea, studentArea and wifiRange, as well
THE TRAININGBUS CLASS(15 marks) The TrainBus class is a specialized Bus. It stores private integer data items that represent teacherArea, studentArea and wifiRange, as well as an ArrayList of strings, each of which represent a course for which the bus will be configured. Methods of TrainingBus are as follows 1. TrainingBus (String name, int basePrice, int wifiRange, int lev, Ministry mny, int teacherArea, int studentArea, String sportList) initialize instance -Set the size of the associated parent class is as the sum teacherArea + studentArea; - append ,TRAINING to the protected tripTypes attribute of the superclass - split the sportList into an array, then populate the list of sports from the array (Hint. Splitting a delimited string can be achieved using String.split()) 2. double getTeacherArea() returns the area available for teachers 3. double getStudentArea() returns the area available for students 4. int getBasePrice() returns 2 * the base price of the superclass 5. int getEstimate(String type, int numPersons, int level) returns the 5 x teacherArea x the getEstimate method of the superclass, divided by the number of courses managed.
import java.util.ArrayList;
public class Bus { private String name; private int size; private int basePrice; private ArrayList
THE PARTYBUS CLASS(40 marks) Some persons were concerned over whether a ministry should be getting involved with an activity that could be considered non-productive. To appease detractors, the ministry came up with a solution that every party should have a purpose. The effect on your implementation is that your PartyBus will be EITHER a specialized SportBus or a specialized TrainingBus. Note also that the Ministry of Transport wants to evaluate multiple potential solutions, so has prescribed that the pool of programmers (which include you), submit a solution that meets the following criteria: If the first letter of your surname is M or smaller, a PartyBus is a specialized SportBus.
calculation for PartyBus Estimated value
foodArea x superclass getEstimate(type, numPersons, level)/(3 x barArea)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started