Write a program that defines a shape base class with a constructor that gives value to width
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program that defines a shape base class with a constructor that gives value to width and height.
Then define two derived classes triangle and rectangle, that calculate the area of the shape. In the main,
define two variables a triangle and a rectangle and then compute their area.
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: