Question: 1. Open the VB2015Chap11Formula SolutionFormula Solution (Formula Solution.sln) file. Open the Areas.vb file, which contains the Parallelogram class definition. The class contains two Public properties

1. 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.

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