Write the statement that would be used in the main program to display the area of MySquare.
Question:
Write the statement that would be used in the main program to display the area of MySquare.
Transcribed Image Text:
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
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 45% (11 reviews)
Answered By
Bhartendu Goyal
Professional, Experienced, and Expert tutor who will provide speedy and to-the-point solutions. I have been teaching students for 5 years now in different subjects and it's truly been one of the most rewarding experiences of my life. I have also done one-to-one tutoring with 100+ students and help them achieve great subject knowledge. I have expertise in computer subjects like C++, C, Java, and Python programming and other computer Science related fields. Many of my student's parents message me that your lessons improved their children's grades and this is the best only thing you want as a tea...
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Determine the critical values that would be used in testing each of the following null hypotheses using the classical approach. Ho: Ho: Ho: 0 vs. Ha: 0, with n 18 and 0 vs. Ha: > 0, with n 32...
-
a. Measure all the voltages and currents indicated. - Note that elements are connected in parallel. Follow best practices covered in the lecture for parallel connection of elements to one point. b....
-
Determine the bounds on the p-value that would be used in testing each of the following null hypotheses using the p-value approach: Ho: Ho: Ho: 0 vs. Ha: 0, with n :-32 and r 0.41 0 vs. Ha: > 0,...
-
Multiple Select Question Select all that apply Identify what might happen if a particular department were eliminated. (Check all that apply.) Multiple select question. Many of the indirect expenses...
-
What is meant by the statement "Exposure is a regression coefficient?"
-
As the vice president of finance for a U.S. firm, what do you say to your production manager when he states, We shouldnt let foreign exchange risk interfere with our profitability. Lets simply...
-
Based upon PCAOB Release 2004-001, what are some strong indicators of material weakness in internal control over financial reporting?
-
A bank considers acquiring new computer equipment. The computer will cost $160,000 and result in a cash savings of $70,000 per year (excluding depreciation) for each of the five years of the assets...
-
Hello, I study government and institutional accounting and I need help with internal services funds, I have already learned that internal services funds are required to account for any activity tha...
-
There is a lottery with n coupons and n people take part in it. Each person picks exactly one coupon. Coupons are numbered consecutively from 1 to n, n being the maximum ticket number. The winner of...
-
Write the statement that would be used in the main program to compute the area of MySquare. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End...
-
List all attributes of an object in the class Rectangle. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End Constructor Public Subprogram SetSide...
-
A roller-coaster car has a potential energy of 450 000 J and a kinetic energy of 120 000 J at point A in its travel. At the low point of the ride, the potential energy is zero, and 50 000 J of work...
-
Review the Filter Bubble video Beware online "filter bubbles" Eli Pariser https://www.youtube.com/watch?v=B8ofWFx525s&t=26s What examples have you seen where a website has customized your content? ...
-
Let W= H : x, y = R, 1-y=1 is a subset of R2. Determine whether Wis a subspace of R or not.
-
This week we will look at the Conference Board's Economic Forecast for the U.S. Economy.The Conference Board is a non-profit Global Research Organization that studies national economies and industry...
-
The following product costs are available for Haworth Company on the production of chairs: direct materials, $ 1 3 , 9 5 0 ; direct labor, $ 2 2 , 0 0 0 ; manufacturing overhead, $ 2 1 , 2 0 0 ;...
-
A physical inventory of Liverpool Company taken at December 31 reveals the following. Per Unit Item Units Cost Market Car audio equipment Speakers 352 $ 107 $ 115 Stereos 267 128 118 Amplifiers 333...
-
Use the appropriate information from the data provided below to calculate operating income for the year ended December 31, 2011. Cost of goods sold General and administrative expenses Net cash...
-
Explain the buyers position in a typical negotiation for a business. Explain the sellers position. What tips would you offer a buyer about to begin negotiating the purchase of a business?
-
Write a method in Java to change an unsigned 32-bit integer representing a mask to an integer representing a prefix (/n).
-
Assume we design a new client-server application program that requires persistent connection. Can we use UDP as the underlying transport-layer protocol for this new application?
-
In DNS, which of the following are FQDNs and which are PQDNs? a. xxx b. xxx.yyy.net c. zzz.yyy.xxx.edu.
-
It is estimated that US companies lose what percent of their annual revenues to fraud? O b. 5% c. 10% O d. 15% a. 2%
-
Chapter 9 Question 2: Which variances require the Master (Planning) Budget to calculate? a. Total Profit Variance and Sales Volume Variance b. Total Profit Variance and All Variable Cost variances c....
-
Chapter 5 - Ratio Analysis - HW Hospitality Industry Managerial Accounting, 8 th Edition ( R . S . Schmidgall )
Study smarter with the SolutionInn App