Write the statement that would be used in the main program to compute the area of MyRectangle.
Question:
Write the statement that would be used in the main program to compute the area of MyRectangle.
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: 70% (10 reviews)
Answered By
Muhammad Haroon
More than 3 years experience in teaching undergraduate and graduate level courses which includes Object Oriented Programming, Data Structures, Algorithms, Database Systems, Theory of Automata, Theory of Computation, Database Administration, Web Technologies etc.
5.00+
3+ 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,...
-
The combined sewer system in city ABC is comprised of two parallel interceptors referred to as "North" and "South" lines. The southern line is connected to a newly built wastewater treatment plant....
-
You work for an Argentinian importer and expect to pay 1 million in one year to a European supplier. You can trade at the following prices: Spot rate, Argentinean australs per euro AA24.38/ One-year...
-
Can objectives always be identified and scheduled?
-
An appropriation account is not part of the income statement for which type of business organisation? a. Sole proprietorship b. Partnership c. Limited company d. Pic (public limited company)
-
On January 1, 2012, Jungle Company sold a machine to Safari Company for $30,000. The machine had an original cost of $24,000, and accumulated depreciation on the asset was $9,000 at the time of the...
-
stion 4 bounded region shown for each problem repres he given cross sections. Set up the integral(s) fir y = x
-
If one driver is randomly selected, find the probability he or she was using a seatbelt. Use the data in the accompanying table and express all results in decimal form. (The data are from ?Mortality...
-
Write the statement that would be used in the main program to set the length of the side of MyRectangle equal to 15 and the height equal to 25. 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...
-
The Cozine Corporation operates a garbage hauling business. Up to this point, the company has been charged a flat fee for each of the garbage trucks that enters the county landfill. The flat fee is...
-
Suppose at a particular restaurant you have 6 choices for an appetizer, 1 choices for a main course, and 2 choices for dessert. If you are allowed to choose exactly one item from each category for...
-
" The budgeted production and sales of a product were 20,000 units for December 2020. Actual production and sales were 19,250 units for the month. For the budgeted production, the company estimated...
-
Explain the following terms : Buzz Marketing Guerilla Marketing Let say, victoria secret pink the marketing idea or tactic to target the preteens is intentional. Is this more relevant to the idea of...
-
Class A had 18 students with an average score of 79 and a standard deviation of 8.2 Class B had 21 students with an average score of 81 and a standard deviation of 5.2 Using an alpha level of 0.05,...
-
An underground airway is driven at a capital cost of $1.15 million. In its eight year life it is planned to pass an airflow of 1080 m3 /s at a frictional pressure drop of 720 Pa. The main fans...
-
Describe the five-step process for crisis risk assessment.
-
A business had revenues of $280,000 and operating expenses of $315,000. Did the business (a) Incur a net loss (b) Realize net income?
-
Both HTTP and FTP can retrieve a file from a server. Which protocol should we use to download a file?
-
Using RFC 1939, assume a POP3 client is in the download-and-delete mode. Show the transaction between the client and the server if the client has only two messages of 230 and 400 bytes to download...
-
Assume we need to download an audio using FTP. What file type should we specify in our command?
-
Cyclizar Inc. provided S4,000 of services with the customers promising to pay next week. In the journal entry written, what would go in box d? A) Cash B) Accounts Receivable C) Revenue D) Accounts...
-
ANSWER IN YOU OWN WORDS! Dont forget to provide references. Thank you. 1. Explain the process by which assets are written up (or down) on intercompany asset transfers and why GAAP prohibits the...
-
Question 4 i need answer asap The following information is given for Rise Up Sdn.Bhd: Unit sales price RM15 Variable cost per unit RM7 Total Fixed cost RM55,OOO Required: a) Calculate the...
Study smarter with the SolutionInn App