* An e-commerce site applies various discounts at checkout: no discount, * 10% off, 20% off, flat $5 off, and buy-one-get-one (BOGO). * All discount logic lives in one method with growing if-else ...
Write a program to calculate the area of a Rectangle and a Triangle using inheritance from a superclass Dimension.