Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN PYTHON PLEASE Exercise #2: Design and implement a program (name it ComputeAreas) that defines four methods as follows: Method squareArea (double side) returns the

IN PYTHON PLEASE

Exercise #2: Design and implement a program (name it ComputeAreas) that defines four methods as follows:

Method squareArea (double side) returns the area of a square.

Method rectangleArea (double width, double length) returns the area of a rectangle.

Method circleArea (double radius) returns the area of a circle.

Method triangleArea (double base, double height) returns the area of a triangle.

In the main method, test all methods with different input value read from the user. Document your code and properly label the input prompts and the outputs as shown below.

Sample run:

Square side: 5.1

Square area: 26.01

Rectangle width: 4.0

Rectangle length: 5.5

Rectangle area: 22.0

Circle radius: 2.5

Circle area: 19.625

Triangle base: 6.4

Triangle height: 3.6

Triangle area: 11.52

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions