Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java 1. Use the following comments as a guide to calculate the area of shapes given in the formulas below: public class ShapeArea 1

image text in transcribedin java
1. Use the following comments as a guide to calculate the area of shapes given in the formulas below: public class ShapeArea 1 // Write a default constructor that initiate the sides of the shape with value 3, and another and overloaded constructor to assign the value of shapes sides given from the user. // Write set and get methods for all instance variables. // TriangleArea will calculate the area of triangle as formula triangle Where b = basa, n= height // ParallelogramArea will calculate the area of parallelogram as formula parafieogram bhWhere base, he height // display method will print the area of the chosen shape using get methods. 1 2. Write the Area App codes that will set 2 objects of shapeArea. Use set methods to assign the values received from the user, calculate the area of chosen shape, and display the area as the sample output given below. Sample output: Welcome to Area of Shapes App Choose which shape you would like to calculate its area (Enter 1 for Triangle, or 2 for Parallelogram): 2 Please Enter Base: 5 Please Enter Height: 7 Area of Parallelogram - 35 Would you like to calculate the area of another shape (1:Yes, 0:No)? 1 Choose which shape you would like to calculate its area (Enter 1 for Triangle, or 2 for Parallelogram): 1 Please Enter Base: 5 Please Enter Height: 7 Area of triangle = 17.5 Would you like to calculate the area of another shape (1:Yes, 0:No)? 0 Thank you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago