Question: CIS 2 1 4 , Week 3 , Fun with OOP and Bicycles As your first chance to explore the wonderful world of object -
CIS Week Fun with OOP and Bicycles
As your first chance to explore the wonderful world of objectoriented programming, I
thought this would be a good time to play with a bicycle. Everyone likes bicycles
except Calvin of course.
This week you are going to create a Bicycle class that can be used to create a digital
bicycle.
Were going to strip off all the nonessential components brakes for example and
focus on the things that make the bicycle go faster If youre wondering where the idea
for this project came from, in grade school I was the smallest, skinniest, slowest kid in
my class. But I was the only one who owned a threespeed Schwinn and you let me
crank the pedals three times and no one could catch me So were going to build a
bicycle with a focus on speed.
Your Bicycle class will have the following attributes and no more
Gears through
Cadence rpm through rpm In cycling, cadence is the rate at which a cyclist is
turning the pedals.
Speed in miles per hour
Your Bicycle class will have the following behaviors and no more
The rider will be able to enter gear settings between and
The rider will be able to enter a cadence between and
Given a gear setting and cadence, the Bicycle will be able to calculate its speed in miles
per hour and output that result.
Rules for calculating MPH in various gear settings
First gear MPH cadence
Second gear MPH cadence
Third gear MPH cadence
You will create a Bicycle class Bicyclejava that follows the specification above. Then
you will create an application to test the Bicycle class BicycleTestjava The application
will instantiate a Bicycle object, then permit the rider to enter a cadence and gear
setting. The rider will be prompted to enter a cadence between and and a gear
setting between and Once the cadence and gear setting have been entered, the
application will output the bicycles speed.
Class members will be declared public and private as appropriate.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
