Question: Implement the class RtTriangle in the shape class hierarchy in Chapter 1. Your class must include 2 data fields: base and height, and 3 methods:

Implement the class RtTriangle in the shape class hierarchy in Chapter 1. Your class must include 2 data fields: base and height, and 3 methods: computeArea(), computePerimeter(), readShapeData(). Hints: 1. a: base, b: height; area A = a x b / 2 ; the perimeter P=a+b+ squareroot of a^2+b^2 2. make sure that your class RtTriangle is a subclass of Shape.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!