Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA use Netbeans Create a class named Bicycle and instantiate the following instance variables. bikeOwner, cadence, gear, speed 1. Include default and overloaded constructor to
JAVA use Netbeans
Create a class named Bicycle and instantiate the following instance variables. bikeOwner, cadence, gear, speed 1. Include default and overloaded constructor to set the values of instance variables. 2. Write methods to set the values for each of the instance variable (except for speed). 3. Write two different methods to change the speed value and name the two methods as applyBrake and speedUp. Note: When the applyBrake method is called by the main class, the value of the speed should decrement (The decrement value will be passed in the arguments of the applyBrake Method) When the speedup method is called by the main class, the value of the speed should increment. (The Increment value will be passed in the arguments of the speedup Method) 4. Write methods to get the values for each of the instance variables. 5. Write main method to test all the methods from your Bicycle Sample run: run: ----------Bicycle data through overloaded constructor------- Bicycle Owner's name:hari cadence :120 rpm gear : 11 speed : 15.9 mph ----------Bicycle data after using set methods-- Bicycle Owner's name : adam cadence : 150 rpm gear : 18 ----After changing the speed using applyBrake or speedup methods--- speed : 20.9 mph BUILD SUCCESSFUL (total time: 0 seconds) 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