Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Design and implement a set of classes and interfaces and use them to evaluate the RTA's resource requirements. 

Your program must meet the subsequent guidelines:

- You must use at least one abstract class, with appropriate final and abstract methods, and at least one interface; you may wish to have several abstract classes and interfaces. You must have at least one abstract method and one final method in at least one class.

- You may not represent the route type (bus, urban rail or commuter rail) or the right of way type (shared or dedicated) as a data member.

- Each subclass must inherit its data and methods from a superclass or an interface to the maximum extent possible. Override superclass methods as needed.

- Each subclass must not contain data that is not relevant. For example, the Red Line may not have stops or additional vehicles, and the 77 bus may not have stations, staff per train, vehicles per train, or staff per station. A subclass must not have any data marked "na" in the table above. You may not set "na" variables equal to one in a subclass that does not use them; they must not be present.

- If a route type has a certain data member, your design must require that it be present. For example, your design must require all shared ROW routes to have a number of stops. All urban rail and commuter rail routes must have a number of stations, staff/station and staff/train. o An interface cannot force an implementing class to have a data member, but if the interface has a method getX(), the implementing method will need to either have a data member X or compute X. This meets the requirement of the problem set.

- You may use protected access for data members to be inherited by subclasses, except that any data member managed by a final method must be private.

- Data members and methods must be defined in the highest level of the inheritance tree possible. For example, the data members that exist for all routes must be defined in a Route class, not in BusRoute, UrbanRailRoute or CommuterRail classes. o All of your methods will be very simple; they should all be just one line.

- You must write classes or subclasses for the combinations of Route and ROW listed at the in the table above. You should not write any other combination of Route and ROW. o You do not need to have a class for bus routes just on dedicated ROW o You do not need to have a class for urban rail routes just on shared ROW

- You must write a class RouteTest with only a main() method to test your software. In main(), write code to:

- Create objects for five routes: bus 77, Silver Line/Airport, Red Line, Green Line B and Lowell Line

- Compute and output (System.out.println) the number of vehicles and staff required for each route, including the number of engines for commuter rail routes. You will have fractional values, which is fine.

- Output the number of stops and/or stations for each route.

- Compute and output the total number of vehicles for bus routes, for urban rail routes and for commuter rail routes. (This will be three totals) You must use the instanceOf keyword in your loop to determine what kind of vehicle is used on a route, since all routes have the
same getVehicle() method. Include commuter rail engines, using getEngine().

- Compute and output the total staff across all routes.

Java, Programming

  • Category:- Java
  • Reference No.:- M9717515
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Java

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As