Line, 32 class TestRectangle2{ public static void main(String args]X Rectangle r1=new Rectangle(); Rectangle r23new Rectangle(); Rectangle r3=new Rectangle(); r1.insert(10,5); r2.insert(3,5); r3.insert(2); r1.display1(); r1.display2(); r1.calculateArea(); r2.calculateArea2()3; r2.display1(); r2.display2(); r2.calculateArea(); r2.calculateArea2(); r3.calculateArea3(); r3.display1(0); 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 } 51 } b) 10 c) 30 d) 50 31. What is the output of line 40? a) 5 32. What is the output of line 41? a) 5 b) 10 c) 30 d) 50 33. What is the output of line 42? a) 5 34. What is the output of line 43? a) 5 b) 10 c) 30 d) 50 35. What is the output of line 44? a) 3 b) 5 c) 15 d) 30 36. What is the output of line 45? a) 3 b) 5 c) 15 d) 30 37. What is the output of line 46? a) 3 b) 5 c) 15 d) 30 38. What is the output of line 47? a) 3 b) 5 c) 15 d) 30 39. What is the output of line 48? a) 0 b) 2 c) 3 d) 5 40. What is the output of line 49? a) 0 b) 10 c) 30 d) 50 b) 2 c) 3 d) 5
Line, 32 class TestRectangle2{ public static void main(String args]X Rectangle r1=new Rectangle(); Rectangle r23new Rectangle(); Rectangle r3=new Rectangle(); r1.insert(10,5); r2.insert(3,5); r3.insert(2); r1.display1(); r1.display2(); r1.calculateArea(); r2.calculateArea2()3; r2.display1(); r2.display2(); r2.calculateArea(); r2.calculateArea2(); r3.calculateArea3(); r3.display1(0); 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 } 51 } b) 10 c) 30 d) 50 31. What is the output of line 40? a) 5 32. What is the output of line 41? a) 5 b) 10 c) 30 d) 50 33. What is the output of line 42? a) 5 34. What is the output of line 43? a) 5 b) 10 c) 30 d) 50 35. What is the output of line 44? a) 3 b) 5 c) 15 d) 30 36. What is the output of line 45? a) 3 b) 5 c) 15 d) 30 37. What is the output of line 46? a) 3 b) 5 c) 15 d) 30 38. What is the output of line 47? a) 3 b) 5 c) 15 d) 30 39. What is the output of line 48? a) 0 b) 2 c) 3 d) 5 40. What is the output of line 49? a) 0 b) 10 c) 30 d) 50 b) 2 c) 3 d) 5
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
JAVA
Answer the following questions :
![Line,
32 class Test Rectangle2{
public static void main (String args[]){
Rectangle r1=new Rectangle();
Rectangle r2=new Rectangle();
Rectangle r3-new Rectangle();
r1.insert(10,5);
r2.insert(3,5);
r3.insert(2);
r1.display1();
r1.display2(%3;
r1.calculateArea();
r2.calculateArea2()3;
33
34
35
36
37
38
39
40
41
42
43
44
r2.display1();
r2.display2();
r2.calculateArea();
r2.calculateArea2();
r3.calculateArea3();
45
46
47
48
r3.display1()3;
50 }
51 }
49
31. What is the output of line 40? a) 5 b) 10 c) 30 d) 50
32. What is the output of line 41? a) 5 b) 10 c) 30 d) 50
33. What is the output of line 42? a) 5
34. What is the output of line 43? a) 5
35. What is the output of line 44? a) 3 b) 5 c) 15 d) 30
36. What is the output of line 45? a) 3 b) 5 c) 15 d) 30
37. What is the output of line 46? a) 3 b) 5 c) 15 d) 30
38. What is the output of line 47? a) 3 b) 5 c) 15 d) 30
39. What is the output of line 48? a) 0 b) 2 c) 3 d) 5
40. What is the output of line 49? a) 0 b) 2 c) 3 d) 5
b) 10 c) 30 d) 50
b) 10 c) 30 d) 50](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8ecd461e-7da2-4221-99d0-69224f92f6d8%2Fe7699248-55f7-4149-85a0-be67c896b3f7%2Fjvdyiq_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Line,
32 class Test Rectangle2{
public static void main (String args[]){
Rectangle r1=new Rectangle();
Rectangle r2=new Rectangle();
Rectangle r3-new Rectangle();
r1.insert(10,5);
r2.insert(3,5);
r3.insert(2);
r1.display1();
r1.display2(%3;
r1.calculateArea();
r2.calculateArea2()3;
33
34
35
36
37
38
39
40
41
42
43
44
r2.display1();
r2.display2();
r2.calculateArea();
r2.calculateArea2();
r3.calculateArea3();
45
46
47
48
r3.display1()3;
50 }
51 }
49
31. What is the output of line 40? a) 5 b) 10 c) 30 d) 50
32. What is the output of line 41? a) 5 b) 10 c) 30 d) 50
33. What is the output of line 42? a) 5
34. What is the output of line 43? a) 5
35. What is the output of line 44? a) 3 b) 5 c) 15 d) 30
36. What is the output of line 45? a) 3 b) 5 c) 15 d) 30
37. What is the output of line 46? a) 3 b) 5 c) 15 d) 30
38. What is the output of line 47? a) 3 b) 5 c) 15 d) 30
39. What is the output of line 48? a) 0 b) 2 c) 3 d) 5
40. What is the output of line 49? a) 0 b) 2 c) 3 d) 5
b) 10 c) 30 d) 50
b) 10 c) 30 d) 50

Transcribed Image Text:TEST II. PROGRAM TRACING
Line
class Rectangle{
int length,width,length%3B
void insert(int I,int w){
length=l3B
width=Dw3;
}
void insert(int I){
length1=l;
}
void display1()
{
System.out.println(width)3;
2.
4
6.
9.
10
11
12
13
14
void display2()
15
{
System.out.printIn(length)3B
}
void calculateArea()
16
17
18
19
20
System.out.printIn(length*width)3B
21
22
23
void calculateArea3()
24
{
System.out.printIn(length1);
26
25
27
void calculateArea2()
28
{
29 System.out.println(length*width*2);
30
}
31
Expert Solution

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 4 steps

Recommended textbooks for you

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

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…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

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)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY