Open the VB2015Chap11Formula SolutionFormula Solution (Formula Solution.sln) file. Open the Areas.vb file, which contains the Parallelogram class

Question:

Open the VB2015\Chap11\Formula Solution\Formula Solution (Formula Solution.sln) file. Open the Areas.vb file, which contains the Parallelogram class definition. The class contains two Public properties and two constructors. It also contains a GetArea method that calculates the area of a parallelogram.

a. Create a derived class named Triangle. The derived class should inherit the properties and GetArea method from the Parallelogram class. However, the Triangle class’s GetArea method should calculate the area of a triangle. The formula for calculating the area of a triangle is base * height / 2. Be sure to include a default constructor and a parameterized constructor in the derived class.

b. The btnCalc_Click procedure should display either the area of a parallelogram or the area of a triangle. The appropriate area to display depends on the radio button selected in the interface. Code the button’s Click event procedure, and then test the application appropriately.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: