35 to 40.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

--35 to 40.

 

 

Line,
32 class Test Rectangle2{
33
34
35
36
37
38 r2.insert(3,5);
39 r3.insert(2);
40 r1.display1();
41 r1.display2();
42 r1.calculateArea();
43 r2.calculateArea2();
44 r2.display1();
45 r2.display2();
46 r2.calculateArea();
47 r2.calculateArea2();
48 r3.calculateArea3();
49 r3.display1();
50 }
51 }
public static void main(String args[]){
Rectangle r1=new Rectangle();
Rectangle r2-new Rectangle();
Rectangle r3=new Rectangle();
r1.insert(10,5);
31. What is the output of line 40? a) 5
32. What is the output of line 41? a) 5
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
36. What is the output of line 45? a) 3
37. What is the output of line 46? a) 3
38. What is the output of line 47? a) 3
39. What is the output of line 48? a) 0
40. What is the output of line 49? a) 0
b) 10
b) 10
b) 10
b) 10
b) 5
b) 5
b) 5
b) 5
b) 2
b) 2
c) 30
c) 30
c) 30
c) 30
c) 15
c) 15
c) 15
c) 15
c) 3
c) 3
d) 50
d) 50
d) 50
d) 50
d) 30
d) 30
d) 30
d) 30
d) 5
d) 5
Transcribed Image Text:Line, 32 class Test Rectangle2{ 33 34 35 36 37 38 r2.insert(3,5); 39 r3.insert(2); 40 r1.display1(); 41 r1.display2(); 42 r1.calculateArea(); 43 r2.calculateArea2(); 44 r2.display1(); 45 r2.display2(); 46 r2.calculateArea(); 47 r2.calculateArea2(); 48 r3.calculateArea3(); 49 r3.display1(); 50 } 51 } public static void main(String args[]){ Rectangle r1=new Rectangle(); Rectangle r2-new Rectangle(); Rectangle r3=new Rectangle(); r1.insert(10,5); 31. What is the output of line 40? a) 5 32. What is the output of line 41? a) 5 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 36. What is the output of line 45? a) 3 37. What is the output of line 46? a) 3 38. What is the output of line 47? a) 3 39. What is the output of line 48? a) 0 40. What is the output of line 49? a) 0 b) 10 b) 10 b) 10 b) 10 b) 5 b) 5 b) 5 b) 5 b) 2 b) 2 c) 30 c) 30 c) 30 c) 30 c) 15 c) 15 c) 15 c) 15 c) 3 c) 3 d) 50 d) 50 d) 50 d) 50 d) 30 d) 30 d) 30 d) 30 d) 5 d) 5
TEST II. PROGRAM TRACING
Line
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 System.out.println(length1);
26 }
27 void calculateArea2()
28 {
29
30
31
class Rectangle{
int length,width,length1;
void insert(int l,int w){
length=l;
width=w;
}
void insert(int i) {
length1=l;
}
void display1()
{
System.out.println(width);
}
void display2()
{
}
)
System.out.println(length);
}
void calculateArea()
{
System.out.println(length*width);
}
void calculateArea3()
System.out.println(length*width*2);
Transcribed Image Text:TEST II. PROGRAM TRACING Line 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 System.out.println(length1); 26 } 27 void calculateArea2() 28 { 29 30 31 class Rectangle{ int length,width,length1; void insert(int l,int w){ length=l; width=w; } void insert(int i) { length1=l; } void display1() { System.out.println(width); } void display2() { } ) System.out.println(length); } void calculateArea() { System.out.println(length*width); } void calculateArea3() System.out.println(length*width*2);
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education