Question: __________________________________________________________________________ AmusementRide.java : import java.util.*; public abstract class AmusementRide extends Object { public final static String DFLT_NAME = Ride With No Name; public final static
__________________________________________________________________________
AmusementRide.java :
import java.util.*; public abstract class AmusementRide extends Object { public final static String DFLT_NAME = "Ride With No Name"; public final static double DFLT_PRICE = 0.0; public final static int DFLT_CAPACITY = 0; /** * Construct an AmusementRide object. * * @param n the name of the AmusementRide * @param p the price of the AmusementRide * @param c the capacity of the AmusementRide */ public AmusementRide(String n, double p, int c) { name = (n == null) ? DFLT_NAME : n; price = (p __________________________________________________________________________
The first four lines of the program's output MUST match the following.
Ferris wheel "The Billy Preston" has capacity of 50 and costs $6.28 ...height: 100; # of spins: 0 Roller coaster "for(;;) Young" has capacity of 32 and costs $3.14 ...maxSpeed: 99; trackLength: 25; whiplashFactor: 1.618
Specification Copy the program AmusementRide.java to your computer and add your own class that extends class AmusementRide Note: AmusementRide.iava contains two classes (class FerrisWheel and class RollerCoaster) that provide examples for the class you must create Your class must include the following . Implementations for all of the abstract methods defined in abstract class AmusementRide . At least one static class variable and at least one instance variable that are not defined in abstract class AmusementRide A toString() method to return a String representation of your ride objects. The String must contain the String returned from the inherited toString() method The main() method in abstract class AmusementRide must keep the class FerrisWheel and class RollerCoaster objects. The method must also keep the following behavior: // pseudo-code.. . obj.load() if (obj.start)) obj.stop) else obj.repair() However, the main() method must be changed to so that it exploits polymorphism. [hint: array] The first four lines of the program's output must match the following Ferris wheel "The Billy Preston" has capacity of 50 and costs $6.28 height: 100; # of spins : 0 Roller coaster "for) Young" has capacity of 32 and costs $3.14 . . .maxSpeed: 99 trackLength: 25; whiplashFactor: 1.618 Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
