Given an incomplete program in Program 2, complete the program by filling in the blanks with an appropriate Java statement to generate the output, as shown in Figure 2. Write your answer in Table 2. UTM UTM NNN 29 UTM UTM private String : private int k TM UTM 1 UTM } //Deciare class, named Flower that inherits classUTAUTM //Program 2 named Flower //2 marks TM public Flowerl (String 3) //Call superclass constructor with 2 argumente //a part of the output in Part 2 UTM TM (b) 7 buds Orchid Hello in default Flower 2 Hibiscus (s) bouquet 2 types of flowers TM 5 buds Lily Beautiful Lily this.3-57 Print in Flower2: 2 Daisy Print in base: 5 Lily Print in Flowerl: 3 Lily Figure 2 UTM public Flowerl (String j, int k) { this.- 3 this.k- k //Assign attribute k with an appropriate value //to produce a part of the output in Part 4 1/2 marks ts\n", 3); System.out.printf("Beautiful public void print () { voTM Part 1 Parts UTM Part 4 1/3 marksTMUUTM System.out.printf("dis (s) bouquet\n", k Part 2 UTM UTM UTM //Write an appropriate statement to produce //a part of the output in Part 4 (d) 1/2 marks System.out.printf("Print in Flowerl: td tain", produce UTM UTM UTM UTM 81 32 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 //Declare class named Flower2 that inherits class named Flowerl (c) //2 marks UTM 31 private String 57 private int k TN public Flower2 (int k) //Call superclass constructor with 2 arguments to produce //a part of the output in Part 1 (0) this.km //3 marks UTMUTM TM } } GTM class Flower { 93 94 95 96 97 98 99 100 101 102 103) public void System.out.printf ("Print in Flower2: ad es\n", k, j); print() { UTM (UTM UTM UTM UTM private String private int } public Flower () ( //Call another constructor with appropriate arguments //to produce a part of the output in Part 1 (b) //3 marks System.out.println("Hello in default Flower"); attribute with an appropriate value //to produce a part of the output in Part 3 1/2 marks System.out.printf(ed types of flowers\n", k) SUTHE //Write the 2 arguments constructor header with an /appropriate parameter SUT BUT BUT System.out.printf("ad buds s\n", J. k) UTM UTM } } TM TM public void print () { System.out.print in base: id ts\n", (i) this.k-k; this. TM UTM UTM UTM //3 marks class Final UTM public static void main(String [] args) { TM Flower Flower2 p: q UTMUTM (3) System.out.println(); 3. UTM UT UTM //Instantiate object named p by using an appropriate //argument to display the output in Part 1 UTM UTM (1) System.out.println(); //3 marks //Write an //output in Part 3 MO System.out.println(); //Instantiate object named q by using priate UTM //argument to display the output in Part 2 JTM UTM 8UTM AUA 1/3 marks statement to produce the //1 mark UTM 3 //Write an appropriate statement to produce the //output in Part 4 (m) //1 mark matemat MOU
Given an incomplete program in Program 2, complete the program by filling in the blanks with an appropriate Java statement to generate the output, as shown in Figure 2. Write your answer in Table 2. UTM UTM NNN 29 UTM UTM private String : private int k TM UTM 1 UTM } //Deciare class, named Flower that inherits classUTAUTM //Program 2 named Flower //2 marks TM public Flowerl (String 3) //Call superclass constructor with 2 argumente //a part of the output in Part 2 UTM TM (b) 7 buds Orchid Hello in default Flower 2 Hibiscus (s) bouquet 2 types of flowers TM 5 buds Lily Beautiful Lily this.3-57 Print in Flower2: 2 Daisy Print in base: 5 Lily Print in Flowerl: 3 Lily Figure 2 UTM public Flowerl (String j, int k) { this.- 3 this.k- k //Assign attribute k with an appropriate value //to produce a part of the output in Part 4 1/2 marks ts\n", 3); System.out.printf("Beautiful public void print () { voTM Part 1 Parts UTM Part 4 1/3 marksTMUUTM System.out.printf("dis (s) bouquet\n", k Part 2 UTM UTM UTM //Write an appropriate statement to produce //a part of the output in Part 4 (d) 1/2 marks System.out.printf("Print in Flowerl: td tain", produce UTM UTM UTM UTM 81 32 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 //Declare class named Flower2 that inherits class named Flowerl (c) //2 marks UTM 31 private String 57 private int k TN public Flower2 (int k) //Call superclass constructor with 2 arguments to produce //a part of the output in Part 1 (0) this.km //3 marks UTMUTM TM } } GTM class Flower { 93 94 95 96 97 98 99 100 101 102 103) public void System.out.printf ("Print in Flower2: ad es\n", k, j); print() { UTM (UTM UTM UTM UTM private String private int } public Flower () ( //Call another constructor with appropriate arguments //to produce a part of the output in Part 1 (b) //3 marks System.out.println("Hello in default Flower"); attribute with an appropriate value //to produce a part of the output in Part 3 1/2 marks System.out.printf(ed types of flowers\n", k) SUTHE //Write the 2 arguments constructor header with an /appropriate parameter SUT BUT BUT System.out.printf("ad buds s\n", J. k) UTM UTM } } TM TM public void print () { System.out.print in base: id ts\n", (i) this.k-k; this. TM UTM UTM UTM //3 marks class Final UTM public static void main(String [] args) { TM Flower Flower2 p: q UTMUTM (3) System.out.println(); 3. UTM UT UTM //Instantiate object named p by using an appropriate //argument to display the output in Part 1 UTM UTM (1) System.out.println(); //3 marks //Write an //output in Part 3 MO System.out.println(); //Instantiate object named q by using priate UTM //argument to display the output in Part 2 JTM UTM 8UTM AUA 1/3 marks statement to produce the //1 mark UTM 3 //Write an appropriate statement to produce the //output in Part 4 (m) //1 mark matemat MOU
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...
Related questions
Question
Kindly fill out the blanks labeled as letters
![Given an incomplete program in Program 2, complete the program by filling in the blanks
with an appropriate Java statement to generate the output, as shown in Figure 2. Write your
answer in Table 2.
JTM UTM
JTM UTM
JTM
JTMUTM
10
17
19
20
21
23
24
25
26
27
28
UTM
UTM
private String :
private int k
TM
}
7 buds Orchid
Hello in default Flower
Hibiscus (s) bouquet
this.-j;
2
2 types of flowers
5 buds Lily
Beautiful Lily
Print in Flower2: 2 Daisy
Print in base: 5 Lily
Print in Flowerl: 3 Lily
Figure 2
//Program 2
//Declare class named Flower that inherits class named Flower
//2 marks
UTM
this.- 37
this.k - k
UTM
public Flowerl (String j, int k) i
28 UTM
public Flowerl (String 3) UTM
//Call superclass constructor with 2 argumenta UTM
//a part of the output in Part 2
(b)
1/3 marksTM U
//Assign attribute k with an appropriate value
// to produce a part of the output in Part 4
(c)
//2 marks
System.out.printf("Beautiful @s\n", j);
{ } Part.
Part 1
Part 2
Part 3 UTM
Part 4
System.out.printf("ads (s) bouquet\n", k,
OUR
UTM
public void print () {
//Write an appropriate statement to produce
//2 marks
UTM
UTM UTMUTM
produce
UTM UTM UTM
TM //a part of the output in Part 4
(d)
System.out.printf("Print in Flowerl: id ts\n", ₂₁ UTM
ST
32
33
36
38
39
40
42
43
44
45
52
53
54
55
56
57
58
59
60
61
64
71
72
73
76
77
78
79
80
81
82
83
85
86
87
88
89
90
91
//Declare class named Flower2 that inherits class
UTM
//2 marks
UTM 3
private String j
private int k
TM
J
public Flower2 (int k) {
//Call superclass constructor with 2 arguments to pr
//a part of the output in Part 1
(0)
this.k k
UTM UTM
}
UTA
public void print () {
97
98
99
100
101
102
103}
class Flower (
private String k
private int
public Flower() {
//Assign attribute j with an appropriate value
//to produce a part of the output in Part 3
(g)
//2 marks
System.out.printf("ad types of flowers\n",
TM
System.out.printf ("Print in
UTM UTM
TM
public void print () {
TM
//Write the 2 arguments constructor header with an
//appropriate parameter
SUT
//3 marks
(i)
this.k-k;
this.j-1:
class Final
UTM
public static void main(String
Flower1 q:
Flower2 p:
//Call another constructor with appropriate arguments TM
TM
//to produce a part of the output in Part 1
(h)
//3 marks
System.out.println("Hello in default
Flowers, UTM
//3 marks
Flowers UTM UTM UTM
ad es\n", k, j);
System.out.printf("%d buds %s\n",
System.out.printf ("Print
named Flowerl
in base: td s\n",
UTM UTM UTM
(k)
System.out.println();
//Instantiate object named p by using an
UTM UTM"
TOT to display the output in PartPpropriate
(1)
System.out.println();
//3 marks
(0)
System.out.println();
UM UTM 8 UTM
UTM) UTM
args) {
//Instantiate object named q by using an appropriate TM
//argument
the output in Part 2 M
Table
UTM 8UTM
//Write an appropriate statement to produce the
//output in Part 3
UTM
OUTM UIT
//3 marks
//1 mark
//Write an appropriate statement to produce the
//output in Part 4
(m)
DET E
OM OUTM
//1 mark](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F780241c6-11db-4e8b-bae6-f1bd25fec574%2F3977b941-2208-4ced-b09c-d4d54e48e21a%2Foi9i7z_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Given an incomplete program in Program 2, complete the program by filling in the blanks
with an appropriate Java statement to generate the output, as shown in Figure 2. Write your
answer in Table 2.
JTM UTM
JTM UTM
JTM
JTMUTM
10
17
19
20
21
23
24
25
26
27
28
UTM
UTM
private String :
private int k
TM
}
7 buds Orchid
Hello in default Flower
Hibiscus (s) bouquet
this.-j;
2
2 types of flowers
5 buds Lily
Beautiful Lily
Print in Flower2: 2 Daisy
Print in base: 5 Lily
Print in Flowerl: 3 Lily
Figure 2
//Program 2
//Declare class named Flower that inherits class named Flower
//2 marks
UTM
this.- 37
this.k - k
UTM
public Flowerl (String j, int k) i
28 UTM
public Flowerl (String 3) UTM
//Call superclass constructor with 2 argumenta UTM
//a part of the output in Part 2
(b)
1/3 marksTM U
//Assign attribute k with an appropriate value
// to produce a part of the output in Part 4
(c)
//2 marks
System.out.printf("Beautiful @s\n", j);
{ } Part.
Part 1
Part 2
Part 3 UTM
Part 4
System.out.printf("ads (s) bouquet\n", k,
OUR
UTM
public void print () {
//Write an appropriate statement to produce
//2 marks
UTM
UTM UTMUTM
produce
UTM UTM UTM
TM //a part of the output in Part 4
(d)
System.out.printf("Print in Flowerl: id ts\n", ₂₁ UTM
ST
32
33
36
38
39
40
42
43
44
45
52
53
54
55
56
57
58
59
60
61
64
71
72
73
76
77
78
79
80
81
82
83
85
86
87
88
89
90
91
//Declare class named Flower2 that inherits class
UTM
//2 marks
UTM 3
private String j
private int k
TM
J
public Flower2 (int k) {
//Call superclass constructor with 2 arguments to pr
//a part of the output in Part 1
(0)
this.k k
UTM UTM
}
UTA
public void print () {
97
98
99
100
101
102
103}
class Flower (
private String k
private int
public Flower() {
//Assign attribute j with an appropriate value
//to produce a part of the output in Part 3
(g)
//2 marks
System.out.printf("ad types of flowers\n",
TM
System.out.printf ("Print in
UTM UTM
TM
public void print () {
TM
//Write the 2 arguments constructor header with an
//appropriate parameter
SUT
//3 marks
(i)
this.k-k;
this.j-1:
class Final
UTM
public static void main(String
Flower1 q:
Flower2 p:
//Call another constructor with appropriate arguments TM
TM
//to produce a part of the output in Part 1
(h)
//3 marks
System.out.println("Hello in default
Flowers, UTM
//3 marks
Flowers UTM UTM UTM
ad es\n", k, j);
System.out.printf("%d buds %s\n",
System.out.printf ("Print
named Flowerl
in base: td s\n",
UTM UTM UTM
(k)
System.out.println();
//Instantiate object named p by using an
UTM UTM"
TOT to display the output in PartPpropriate
(1)
System.out.println();
//3 marks
(0)
System.out.println();
UM UTM 8 UTM
UTM) UTM
args) {
//Instantiate object named q by using an appropriate TM
//argument
the output in Part 2 M
Table
UTM 8UTM
//Write an appropriate statement to produce the
//output in Part 3
UTM
OUTM UIT
//3 marks
//1 mark
//Write an appropriate statement to produce the
//output in Part 4
(m)
DET E
OM OUTM
//1 mark
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 7 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY