Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
1. Use the following comments as a guide to calculate the area of shapes given in the formulas below: public class ShapeArea // 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 instante variables. // TriangleArea will calculate the area of triangle as formula triangle area = y*b*h Where b = base, h-height // ParallelogramArea wil calculate the area of parallelogram as formula parallelogram area = bxh Where b = base, h = height // display method will print the area of the chosen shape using get methods. 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. Oncer Sample output: Welcome to Area of Shapes App Choose which shape you would be to attegate acea for Tiangie, or 2 for Parallelogram 2 Das Enter Base: pleans Entor Height Acea paralelogran 35 Would you se calculate the sea o another chapetes DO Choose which hape you wake uren Tanel2 or Parelagram Dicas leagh Wage yer Lanao chap CINO 1. Use the following comments as a guide to calculate the area of shapes given in the formulas below: public class ShapeArea // 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 instante variables. // TriangleArea will calculate the area of triangle as formula triangle area = y*b*h Where b = base, h-height // ParallelogramArea wil calculate the area of parallelogram as formula parallelogram area = bxh Where b = base, h = height // display method will print the area of the chosen shape using get methods. 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. Oncer Sample output: Welcome to Area of Shapes App Choose which shape you would be to attegate acea for Tiangie, or 2 for Parallelogram 2 Das Enter Base: pleans Entor Height Acea paralelogran 35 Would you se calculate the sea o another chapetes DO Choose which hape you wake uren Tanel2 or Parelagram Dicas leagh Wage yer Lanao chap CINO

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions