List all attributes of an object in the class Rectangle. Class Square Declare Protected Side, Area As
Question:
List all attributes 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: 50% (10 reviews)
Sid...View the full answer
Answered By
FREDRICK MUSYOKI
Professional Qualities:
Solution-oriented.
Self-motivated.
Excellent problem-solving and critical thinking skills.
Good organization, time management and prioritization.
Efficient troubleshooting abilities.
Tutoring Qualities:
I appreciate students as individuals.
I am used to tailoring resources for individual needs.
I can integrate IT into student's lessons.
I am good at explaining concepts.
I am able to help students progress.
I have a wide curriculum knowledge.
5.00+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
List all methods 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...
-
While you may not work for a large corporation, there is merit to the notion that the organization must speak with one voice and speak quickly in a crisis. What forces (tradition, practice, and...
-
State how each of the following companies are affected by a real depreciation of the domestic currency: (a) An importer (b) An exporter (c) A diversified multinational corporation competing in...
-
Because existing staff are fully scheduled, if the firm is awarded the contract, it must hire one new staff member at a salary of $52,000 to handle the additional workload. The managing partner is...
-
Conventional management accounting systems provide the foundation for all other accounting systems.What are the main differences and links between conventional management accounting and environmental...
-
1. How serious were the alleged accounting misstatements? As part of your answer, consider whether they were material and whether they were fraudulent. 2. Suppose you were defending Mr. Rand. Could...
-
The CEO and CFO of Coral Gables Corp were having a discussion about which stock to buy with the company\'s surplus cash. The CFO noted that it was important that the company incurs less risk for a...
-
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 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...
-
An investor realizes the market value of a property is \($798\),000. The investor purchased the property eight years ago for \($530\),000. What is the investors annual rate of return for the eight...
-
Michael exerts a force of 100 N on a 55.0 kg wheelbarrow, at an angle of 20.0 below the horizontal. Neglecting friction, what is the horizontal acceleration of the wheelbarrow?
-
A projectile is launched towards a hill that is d= 306m away. The launch angle is=56.9 above the horizontal with an initial speed of v0 =84.6m/s.The hill can be approximated as a plane sloped at...
-
Polling reveals people abhor your decision to raise the retirement age and they force you to lower it again. As a firm leader, you consider raising taxes to $2000 per year on each of the young. While...
-
A 2 . 5 kg model car is traversing a loop track with a radous of 1 . 1 m . What speed must the car have at the bottom of the loop to just go past the top of the loop?
-
Consider the following algorithm. Count (A[], n) /* A=array of n integers */ Hash Table.Init(); S.Init(); /* S is a stack */ for io 1 to n do for i 1 to n do K A[io] * A[i]; if (Hash Table....
-
Why are the degrees of freedom for the t distribution and the degrees of freedom for sample variance the same?
-
Stephen Schor, an accountant in New York City, advised his client, Andre Romanelli, Inc., to open an account at J. P. Morgan Chase Bank, N.A., to obtain a favorable interest rate on a line of credit....
-
Can a host use a TELNET client to get services provided by other clientserver applications such as FTP or HTTP?
-
In FTP, a user (Maria) wants to move a file named file1 from /usr/users/report directory to the directory /usr/top/letters. Note that this is a case of renaming a file. We first need to give the name...
-
The TELNET application has no commands such as those found in FTP or HTTP to allow the user to do something such as transfer a file or access a web page. In what way can this application be useful?
-
Solve the following systems of nonlinear equations to 3 significant figures accuracy using the tearing method: 6x+x, ln x2 + x2x3 = 6 e sin x3-5e=10 x+x+x3 = 5
-
(a) Formulate the ODE for a parachutist, falling under gravity, with velocity v(t), for a viscous drag force model given by Fd = kv(t)j, v(0) = 0. (b) Outline all the steps towards the solution v(t)....
-
The following changes took place last year in Pavolik Company's balance sheet accounts: Asset and Contra-Asset Accounts Cash Accounts receivable Inventory Prepaid expenses Long-term investments...
Study smarter with the SolutionInn App