Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the Following code : public class BicycleManufacturer { // Assuming you are a bicycle manufacturer that needs to keep track of // 1. ID

Complete the Following code :

public class BicycleManufacturer {

// Assuming you are a bicycle manufacturer that needs to keep track of

// 1. ID of each bicycle made (automatically)

// 2. the radius of the wheel

// 3. the price of each bicycle


 

// TODO: Create fields/attributes to keep track of the information



 

// TODO: Create constructors with an automated method to keep track of the bicycle's ID (no mannual ID passing in)

// The ID of each bicycle should be an increment of 1 starting with 1 from the first bicycle object created


 

// TODO: Create setters and getters (bicycle id, radius, and price)



 

// These 2 methods can later use for optimizing the radius and the price

// TODO: Create a method to calculate the packaging size name it getPackageSize by this formula:

// packaging size = 2*4*pi*(radius^2)



 

// TODO: Create a static method to calculate the packaging size name it getTestedPackageSize with radius input parameter instead of using the field

// packaging size = 2*4*pi*(radius^2)

// This is an overload method of previous method but using static method




 

public static void main(String[] args) {

// TODO: Create 3 bicycle objects (redBicycle, blueBicycle, greenBicycle) with the radius and price of your choice.

// You should not passing ID for each bicycle since it is automated process.




 

// TODO: Use getter to get the blueBicycle ID, print that value --> should be 2




 

// TODO: Call getPackageSize using greenBicycle object to get the package size, print that value. Depending on the radius of the greenBicycle




 

// TODO: call getTestedPackageSize with radius input of 2.0 using 3 methods:

// 1. using redBicycle object

// 2. using bicycleManufacturer class

// 3. directly since we are inside bicycleManufacturer file

 

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here is the completed Java code for the BicycleManufacturer class with the requested functionalities public class BicycleManufacturer private static i... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Financial Accounting

Authors: Thomas Beechy, Umashanker Trivedi, Kenneth MacAulay

6th edition

013703038X, 978-0137030385

More Books

Students also viewed these Programming questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago

Question

Bonus shares can be issued out of revenue reserves. True/False?

Answered: 1 week ago