List all methods of an object in the class Rectangle. Class Square Declare Protected Side, Area As
Question:
List all methods of an object in the class Rectangle.
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: 60% (10 reviews)
SetHeight G...View the full answer
Answered By
Joseph Ogoma
I have been working as a tutor for the last five years. I always help students to learn and understand concepts that appears challenging to them. I am always available 24/7 and I am a flexible person with the ability to handle a wide range of subjects.
5.00+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
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...
-
The potential energy of an object in the gravitational field of the earth is Ep mgh. What must be the SI unit of g if this equation is to be consistent with the SI unit of energy for Ep?
-
The acceleration of an object in the space is given by the vector function below: a (t) = t 2 i + e -t j + t k Find the position vector function, r (t), of this object if the initial velocity is 2 i...
-
Accounting for Contingencies and Provisions In accounting, contingencies and provisions play a crucial role in preparing financial statements and ensuring accurate representation of a company's...
-
What is an integrated market? a segmented market? Why is this distinction important in multinational financial management?
-
How should a project manager react when he finds inefficiency in the functional lines? Should executive management become involved?
-
A company selling designer watches bought 400 for 60 each. Normal selling price is 100 per watch, but a change in fashion has resulted in all the watches being saleable at only 30 each, after a...
-
Proponents of critical perspectives research believe that mainstream accounting research relies on assumptions that are considered in a vacuum, which does not mirror reality. Team Debate: Team 1:...
-
Evaluate the line integral Vop-dr for the following function op and oriented curve C (a) using a parametric description of C and evaluating the integral directly, and (b) using the Fundamental...
-
Your hospital has built a new freestanding facility that includes a 36- bed medical telemetry care unit. The patients and staff from the existing smaller units will be combined into the new unit. The...
-
Write the statement that would be used in the main program to display the area of MySquare. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End...
-
Create an instance of the class, Rectangle and reference it with the name MyRectangle. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End...
-
To get a feel for higher order ODEs, show that the given functions are solutions and form a basis on any interval. Use Wronskians. In Prob. 6, x > 0, 1, e -x cos 2x, e -x sin 2x, y"' + 2y" + 5y' = 0
-
Dynamite Co. has fixed manufacturing costs of $50,000, variable selling & admin costs of $10,000 and breakeven sales of $500,000. What is its projected gross margin at $1,000,000 in sales?
-
Calculate the Depreciation using the Declining-Balance method. LiquidHair Inc. buys an expensive machine for 50,000$. It will amortize it using the declining-balance method for 6 years. Its salvage...
-
Eastland Corp. had total variable costs of $173,950, total fixed costs of $118,000, and total revenues of $245,000. Calculate contribution margin ratio. Contribution margin ratio % Compute the...
-
Alafaya has asales forecast of $10 million and has set a goal to earn $4,320,000 in net income in the coming year. The firm manufactures heat resistant components for gas turbine engines that sell...
-
Consider a simple financial market for a closed economy with government, such as might be crudely representative of the world as a whole. a) Construct a diagram to represent this market and note and...
-
In planning for a crisis, the leader has to focus on five integrated tasks. Identify these tasks.
-
Aztec Furnishings makes hand-crafted furniture for sale in its retail stores. The furniture maker has recently installed a new assembly process, including a new sander and polisher. With this new...
-
In FTP, a user (Jan) wants to make a new directory called Jan under the directory/usr/usrs/letters. Show all of the commands and responses.
-
Assume a TELNET client uses ASCII to represent characters, but the TELNET server uses EBCDIC to represent characters. How can the client log into the server when character representations are...
-
In FTP, a user (Jane) wants to retrieve an EBCDIC file named huge from /usr/users/report directory using the ephemeral port 61017. The file is so large that the user wants to compress it before it is...
-
Transaction 3 A one-year store rental lease was signed on March 1 for $1,100 per month, and rent for the first 2 months was paid in advance. [Note: Record the complete entry for the March 1...
-
Production Report, Weighted Average Mino Inc. manufactures chocolate syrup in three departments: Cooking, Mixing, and Bottling. Mino uses the weighted average method. The following are cost and...
-
A table for a monthly bank reconciliation dated September 30 is given below. For each item 1 through 12, indicate whether the item should be added to or subtracted from the book or bank balance, and...
Study smarter with the SolutionInn App