Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions 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
expand button
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
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY