28 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 29 30 31 automated process. 32 33 34 35 // TODO: Use getter to get the blueBicycle ID, print that value --> should be 2 36 37 38 // TODO: Call getPackageSize using greenBicycle object to get the package size, print thạt value. Depending on the radius of the greenBicycle 39 40 41 42 // TODO: call getTestedPackageSize using 3 methods: 1. using redBicycle object 43 44 // 2. using bicycleManufacturer class 3. directly since we are inside bicycleManufacturer file 45 // 46 // 47 48 49

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

PLEASE WRITE CODE IN JAVA

27
28
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.
29
30
31
32
33
34
35
// TODO: Use getter to get the blueBicycle ID, print that value --> should be 2
36
37
38
39
// TODO: Call getPackageSize using greenBicycle object to get the package size, print that value. Depending on the radius of the greenBicycle
40
41
42
/ TODO: call getTestedPackageSize using 3 methods:
1. using redBicycle object
43
44
2. using bicycleManufacturer class
3. directly since we are inside bicycleManufacturer file
45
/
46
//
47
48
49
50
Transcribed Image Text:27 28 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. 29 30 31 32 33 34 35 // TODO: Use getter to get the blueBicycle ID, print that value --> should be 2 36 37 38 39 // TODO: Call getPackageSize using greenBicycle object to get the package size, print that value. Depending on the radius of the greenBicycle 40 41 42 / TODO: call getTestedPackageSize using 3 methods: 1. using redBicycle object 43 44 2. using bicycleManufacturer class 3. directly since we are inside bicycleManufacturer file 45 / 46 // 47 48 49 50
1
þublic class BicycleManufacturer {
2
// Assuming you are a bicycle manufacturer that needs to keep track of
3
//
1. ID of each bicycle made (automatically)
4
//
2. the radius of the wheel
5
//
3. the price of each bicycle
6
7
// TODO: Create fields/attributes to keep track of the information
8
9
// 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
/ See Student.java for an example
10
11
12
13
14
15
/ TODO: Create setters and getters (bicycle id, radius, and price)
16
17
18
// These 2 methods can later use for optimizing the radius and the price
19
// TODO: Create a method to calculate the packaging size name it getPackageSize by this formula:
20
/
packaging size
= 2*4*pi*(radius^2)
21
22
23
// TODO: Create a static method to calculate the packaging size name it getTestedPackageSize with radius input parameter instead of using the field
= 2*4*pi*(radius^2)
// This is an overload method of previous method but using static method
24
//
packaging size
25
26
Transcribed Image Text:1 þublic class BicycleManufacturer { 2 // Assuming you are a bicycle manufacturer that needs to keep track of 3 // 1. ID of each bicycle made (automatically) 4 // 2. the radius of the wheel 5 // 3. the price of each bicycle 6 7 // TODO: Create fields/attributes to keep track of the information 8 9 // 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 / See Student.java for an example 10 11 12 13 14 15 / TODO: Create setters and getters (bicycle id, radius, and price) 16 17 18 // These 2 methods can later use for optimizing the radius and the price 19 // TODO: Create a method to calculate the packaging size name it getPackageSize by this formula: 20 / packaging size = 2*4*pi*(radius^2) 21 22 23 // TODO: Create a static method to calculate the packaging size name it getTestedPackageSize with radius input parameter instead of using the field = 2*4*pi*(radius^2) // This is an overload method of previous method but using static method 24 // packaging size 25 26
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY