Question: public class Bicycle private int mySize: private boolean openFrame; public Bicycle(int size, boolean frame) * implementation not shown */: ) public int getSize() { return

 public class Bicycle private int mySize: private boolean openFrame; public Bicycle(int
size, boolean frame) * implementation not shown */: ) public int getSize()
{ return mySize; ) public Boolean isOpenFrame() { return openFrame; ) public
double getCost() { return getSize() * 25; } 3 public class RoadBike

public class Bicycle private int mySize: private boolean openFrame; public Bicycle(int size, boolean frame) * implementation not shown */: ) public int getSize() { return mySize; ) public Boolean isOpenFrame() { return openFrame; ) public double getCost() { return getSize() * 25; } 3 public class RoadBike extends Bicycle private int myNunGears; public RoadBike(int size, boolean frame) /* implementation not shown / > public RoadBike(int size, boolean frame, int gears) arning Derivative culator Luga /* implementation not shown */ ) public int getNumGears { return my NumGears; ) public double getCost() { /* Missing Code */ ) ) The cost of a Road bike is calculated as follows: if the Road Bike has 10 or fewer gears, the cost is the same as bicycle plus 50. If the Road Bike has between 11 and 20 gears, the cost is the same as bicycle plus 50 and 5 for each additional gear above 10. (e.g., a Road Bike with 12 gears would have a cost equal to the cost of a bicycle + 50 + 2 * 5). If the Road Bike has more than 20 gears, the cost is the same as bicycle plus 500). Option 1: if ( setNumGears()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!