Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls help me INSTRUCTIONS: You are required to write a JAVA program based on the problem description given. Read the problem description and examine the

pls help me image text in transcribed
image text in transcribed
image text in transcribed
INSTRUCTIONS: You are required to write a JAVA program based on the problem description given. Read the problem description and examine the sample of output; then study the program design given. Write a complete program with necessary useful comment for good documentation. Compile and execute the program. Description of the Problem Computers are playing an increasing role in education. Write a program that will help an elementary school student to calculate the area of different shapes as in UML-Class diagram below. ShapeArea base, int height:int - area double + set / get methods + TriangleArea + ParallelogramArea + display 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 ( ) 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 instance variables. // TriangleArea will calculate the area of triangle as formula triangle area =) *b*h Where b = base, h = height // Parallelogram Area will 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. Page 2 of 6 Computer Programming CSIO Tuesday 16 March 2022 ( ) () e 2 2. Write the AreaApp 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. (Enter Sample output: Welcome to Area of Shapes App Choose which shape you would like to calculate its area 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) 2.0 Thank you... ) ( e

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago