Part 1 (Week 15) 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. Part 2 (Week 16) 6. Add three (3) more classes named Parallelogram, Rhombus, and Trapezoid. a. Parallelogram shall inherit from Quadrilateral and shall be the new parent class of Rectangle. Its println() statement shall be "- has 2 pairs of parallel sides". b. Rhombus shall inherit from Parallelogram. Its println() statement shall be "- has 4 congruent sides". c. Trapezoid shall inherit from Quadrilateral. Its println() statement shall be "- has 1 pair of parallel sides". 7. Modify the main method of the RunQuad class. The choices will now be R, S, P, H, and T. Display appropriate description(s).

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

Part 1 (Week 15)
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.

Part 2 (Week 16)
6. Add three (3) more classes named Parallelogram, Rhombus, and Trapezoid.
a. Parallelogram shall inherit from Quadrilateral and shall be the new parent class of
Rectangle. Its println() statement shall be "- has 2 pairs of parallel sides".
b. Rhombus shall inherit from Parallelogram. Its println() statement shall be "- has 4
congruent sides".
c. Trapezoid shall inherit from Quadrilateral. Its println() statement shall be "- has 1 pair
of parallel sides".
7. Modify the main method of the RunQuad class. The choices will now be R, S, P, H, and T. Display
appropriate description(s).

Expert Solution
steps

Step by step

Solved in 3 steps with 7 images

Blurred answer
Knowledge Booster
Class
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
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