rilateral while Square will acquire from Square shape. 3. Pronounce a public strategy named showDescription() in every one of the three (3) classes besides in RunSquad. Alter every technique by making different println() proclamations. a. For Quadrilateral: "- is quadrilateral". b. For Square shape: "- has 4 right points". Add a super() proclamation to call Quadrilateral's strategy. c. For Square: "- has 4 equivalent sides". Add a super() explanation to call Square shape's technique. 4. Code the principal strategy for the RunQuad class. The result will request that the client press R or S to pick either square shape and square. Show fitting description(s). Section 2

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

Hi there Section 1

1. Make a class named RunQuad. This class will contain the principal strategy.
2. Add three (3) classes named Quadrilateral, Square shape, and Square. Square shape will acquire from Quadrilateral while Square will acquire from Square shape.
3. Pronounce a public strategy named showDescription() in every one of the three (3) classes besides in RunSquad. Alter every technique by making different println() proclamations.
a. For Quadrilateral: "- is quadrilateral".
b. For Square shape: "- has 4 right points". Add a super() proclamation to call Quadrilateral's strategy.
c. For Square: "- has 4 equivalent sides". Add a super() explanation to call Square shape's technique.
4. Code the principal strategy for the RunQuad class. The result will request that the client press R or S to pick either square shape and square. Show fitting description(s).

Section 2
6. Add three (3) more classes named Parallelogram, Rhombus, and Trapezoid.
a. Parallelogram will acquire from Quadrilateral and will be the new parent class of Square shape. Its println() explanation will be "- has 2 sets of equal sides".
b. Rhombus will acquire from Parallelogram. Its println() proclamation will be "- has 4 consistent sides".
c. Trapezoid will acquire from Quadrilateral. Its println() proclamation will be "- has 1 sets of equal sides".
7. Change the fundamental technique for the RunQuad class. The decisions will currently be R, S, P, H, and T. Show fitting description(s).. 

 

Sample Output:
Select from the following:
R - Rectangle
S
Square
P
H Rhombus
T
H
A rhombus:
has 4 congruent sides
has 2 pairs of parallel sides
is quadrilateral
I
-
Parallelogram
Trapezoid
Transcribed Image Text:Sample Output: Select from the following: R - Rectangle S Square P H Rhombus T H A rhombus: has 4 congruent sides has 2 pairs of parallel sides is quadrilateral I - Parallelogram Trapezoid
1. Create a class named RunQuad. This class shall contain the main method.
2. Add three (3) classes named Quadrilateral, Rectangle, and Square. Rectangle shall inherit from
Quadrilateral while Square shall inherit from Rectangle.
3. Declare a public method named showDescription() in all three (3) classes except in RunSquad.
Customize each method by creating different println() statements.
a. For Quadrilateral: "- is quadrilateral".
b. For Rectangle: "- has 4 right angles". Add a super() statement to call Quadrilateral's
method.
C. For Square: "- has 4 equal sides". Add a super() statement to call Rectangle's method.
4. Code the main method of the RunQuad class. The output shall ask the user to press R or S to
choose between rectangle and square. Display appropriate description(s).
5. Keep a copy of your program. You will be using it next week.
Sample Output:
Press R for Rectangle or S for Square. S
A square:
has 4 equal sides
has 4 right angles
is quadrilateral
Transcribed Image Text:1. Create a class named RunQuad. This class shall contain the main method. 2. Add three (3) classes named Quadrilateral, Rectangle, and Square. Rectangle shall inherit from Quadrilateral while Square shall inherit from Rectangle. 3. Declare a public method named showDescription() in all three (3) classes except in RunSquad. Customize each method by creating different println() statements. a. For Quadrilateral: "- is quadrilateral". b. For Rectangle: "- has 4 right angles". Add a super() statement to call Quadrilateral's method. C. For Square: "- has 4 equal sides". Add a super() statement to call Rectangle's method. 4. Code the main method of the RunQuad class. The output shall ask the user to press R or S to choose between rectangle and square. Display appropriate description(s). 5. Keep a copy of your program. You will be using it next week. Sample Output: Press R for Rectangle or S for Square. S A square: has 4 equal sides has 4 right angles is quadrilateral
Expert Solution
steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Developing computer interface
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