Implementation: A Java package with the name "Quiz2" is created with a class named "Geometry". In the main method, the user is asked to select if they want to calculate the area or volume. Once the user enters a response, the user is asked to select a shape as shown from the expected output below. Select: [1]Calculate Area [2] Calculate Volume Select a Shape: [A] Square [B]Rectangle [C]Triangle [D]Circle A Enter a: Area of the square: 25.0 sqm.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Computer Science
Create a UML diagram of the following methods & classes (java language) using LucidApp.
Class Name Method Description
Calculation Multiply Multiplies two variables with data type
double and returns the product
Returns the area of the Rectangle using
the method "Multiply" of the "Calculation"
class in the calculation
Rectangle
Area
Rec_Prism
Volume
- Returns the volume of a Rectangular
Prism
- Inherits class "Rectangle" and utilizes
the method "Area" in the calculation
Triangle
Returns the area of the Triangle using the
method “Multiply" of the "Calculation"
class in the calculation
Area
Tri_Prism
Volume
Returns the volume of a Triangular
Prism
- Inherits class "Triangle" and utilizes the
method "Area" in the calculation
Reflexive
Power
- Inherits class "Calculation"
- Returns the product of a number
multiplied by itself based on the
exponent
- Requires two input parameters:
a = the number b= the exponent
- Calls the method "Multiply" to perform
the multiply operation.
Note:
Use Reflexive association and NOT the
Math.pow( ) function.
Example:
Volume of a Cube = a xaxa
a = value entered by the user
b = 3
Returns the area of the circle using an
input parameter for the radius.
Circle
Area
- Inherits class "Reflexive"
- Calls the method "Power" in the
calculation and NOT the Math.pow()
function.
- Returns the volume of a right circular
cylinder
Cir_cylinder Volume
- Inherits class Circle and utilizes the
method “Area" in the calculation
Geometry
main
See "Implementation" section
Transcribed Image Text:Computer Science Create a UML diagram of the following methods & classes (java language) using LucidApp. Class Name Method Description Calculation Multiply Multiplies two variables with data type double and returns the product Returns the area of the Rectangle using the method "Multiply" of the "Calculation" class in the calculation Rectangle Area Rec_Prism Volume - Returns the volume of a Rectangular Prism - Inherits class "Rectangle" and utilizes the method "Area" in the calculation Triangle Returns the area of the Triangle using the method “Multiply" of the "Calculation" class in the calculation Area Tri_Prism Volume Returns the volume of a Triangular Prism - Inherits class "Triangle" and utilizes the method "Area" in the calculation Reflexive Power - Inherits class "Calculation" - Returns the product of a number multiplied by itself based on the exponent - Requires two input parameters: a = the number b= the exponent - Calls the method "Multiply" to perform the multiply operation. Note: Use Reflexive association and NOT the Math.pow( ) function. Example: Volume of a Cube = a xaxa a = value entered by the user b = 3 Returns the area of the circle using an input parameter for the radius. Circle Area - Inherits class "Reflexive" - Calls the method "Power" in the calculation and NOT the Math.pow() function. - Returns the volume of a right circular cylinder Cir_cylinder Volume - Inherits class Circle and utilizes the method “Area" in the calculation Geometry main See "Implementation" section
Implementation:
A Java package with the name "Quiz2"
is created with a class named "Geometry".
In the main method, the user is asked to
select if they want to calculate the area or
volume. Once the user enters a response,
the user is asked to select a shape as
shown from the expected output below.
- --
Select:
[1]Calculate Area
[2]Calculate Volume
1
Select a Shape:
[A] Square
[B]Rectangle
[C]Triangle
[D]Circle
A
Enter a:
Area of the square: 25.0 sqm.
Transcribed Image Text:Implementation: A Java package with the name "Quiz2" is created with a class named "Geometry". In the main method, the user is asked to select if they want to calculate the area or volume. Once the user enters a response, the user is asked to select a shape as shown from the expected output below. - -- Select: [1]Calculate Area [2]Calculate Volume 1 Select a Shape: [A] Square [B]Rectangle [C]Triangle [D]Circle A Enter a: Area of the square: 25.0 sqm.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Adjacency Matrix
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage