Question: Write the statement that would be used in the main program to display the area of MyRectangle. Class Square Declare Protected Side, Area As Float
Write the statement that would be used in the main program to display the area of MyRectangle.

Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End Constructor Public Subprogram SetSide (NewSide) Set Side = NewSide End Subprogram Public Subprogram ComputeArea () Set Area = Side^2 %3! End Subprogram Public Function GetArea() As Float Set GetArea = Area End Function Public Function GetSide () As Float Set GetSide = Side End Function End Class Class Rectangle Extends Square Declare Private Height As Float Public Rectangle() Call Square () Set Height = 1.0 %3! End Constructor Public Subprogram SetHeight (NewHeight) Set Height = NewHeight End Subprogram Public Function GetHeight() As Float Set GetHeight = Height End Function Public Subprogram ComputeArea () Set Area = Side * Height End Subprogram End Class
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
Write T... View full answer
Get step-by-step solutions from verified subject matter experts
