Create an instance of the class Square and reference it with the name MySquare. Class Square Declare
Question:
Create an instance of the class Square and reference it with the name 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: 83% (6 reviews)
Declar...View the full answer
Answered By
Charles mwangi
I am a postgraduate in chemistry (Industrial chemistry with management),with writing experience for more than 3 years.I have specialized in content development,questions,term papers and assignments.Majoring in chemistry,information science,management,human resource management,accounting,business law,marketing,psychology,excl expert ,education and engineering.I have tutored in other different platforms where my DNA includes three key aspects i.e,quality papers,timely and free from any academic malpractices.I frequently engage clients in each and every step to ensure quality service delivery.This is to ensure sustainability of the tutoring aspects as well as the credibility of the platform.
4.30+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
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...
-
Suppose Square1 is an object of the class Square and the statement Call Square1.ComputeArea() appears in the main program. Which formula for area is used in the execution of the subprogram...
-
Suppose that the vertices for an instance of the traveling-salesman problem are points in the plane and that the cost c (u, ) is the euclidean distance between points u and . Show that an optimal...
-
Mr. and Mrs. Thomas are buying a new house for $330,000. Compare the two loan offers by finding the monthly payments for each and calculating the total amount paid for each. Loan Options Down Payment...
-
Copper Kettle, Inc of the United States manufactures (what else?) copper kettles. Copper Kettle imports its raw materials from Chile, and sells most of its goods in the domestic United States....
-
Under what conditions would a conflict result between members of a group over misunderstandings of each others roles?
-
Greystone Hotel projects the cash flows for three alternative investment projects (in $thousands) as follows: Depreciation is $70,000 per year for all three projects. For each project, calculate a....
-
Tiny Corp. prepares monthly bank reconciliations of its checking account balance. The bank statement for October 2009 indicated the following: Balance, October 31, 2009 ................$7,920 Service...
-
An investment has been making money. Its value has been increasing at the rate of 4.1% per year. After 13 years of increase, the investment's current value is $86,840. What was the initial value of...
-
White & Decker Corporations 2019 financial statements included the following information in the long-term debt disclosure note: ($ in millions) Zero-coupon subordinated debentures, due 2033: 2019...
-
Suppose Rectangle1 is an object of the class Rectangle and the statement Call Rectangle1.ComputeArea() appears in the main program. Which formula for area is used in the execution of the subprogram...
-
Write the statement that would be used in the main program to set the length of the side of MySquare equal to 20. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3!...
-
1. Which of the following combinations correctly describes the relationship between foreign currency transactions, exchange rate changes, and foreign exchange gains and losses? .:. 2. In accounting...
-
Ms. Zelda has decided to invest $75,000 in state bonds. She could invest in State A bonds paying 5 percent annual interest or in State R bonds paying 5.4 percent annual interest. The bonds have the...
-
After doing your Team player attitudes you have a score of 47/50 telling you that "you have a strong positive attitudes toward being a team member and working cooperatively with other member"1)What...
-
You are the senior cost accountant at Gutawa Sdn Bhd and you have been asked to explain to the new staff accountant how the company keeps track of job costs through source documents? Also, you need...
-
A firm with current assets of $40 million and current liabilities of $20 million buys $5 million of inventory on credit which increases its inventory level to $10 million. What will the effect be on...
-
The Icelandic krona (ISK) was very strong in the years 2005-2007. What caused the ISK to be so strong then? Then the ISK collapsed in 2008. Why did the ISK collapse?
-
One of the characteristics of a learning organization's culture is that learning is a multilevel organization-wide process. What exactly do we mean by this statement?
-
7. Baladna wants to analyze process that includes delivery by suppliers, production inside the company, transportation to to its customers and information systems. Then it also wants to find out...
-
Modify, compile, and test the client program in Table 25.17 and the server program in Table 25.16 to allow the client to provide the pathname of a short file stored on the server host. The server...
-
A new application is to be designed using the client-server paradigm. If only small messages need to be exchanged between the client and the server without concern for message loss or corruption,...
-
Write a method in Java to extract the IP address (without the prefix) as a string in dotted-decimal notation from a string representing the CIDR notation (x.y.z.t/n).
-
Lunar Entertainment is a provider of cable, Internet, and on-demand video services. Lunar currently sends monthly bills to its customers via the postal service. Because of a concern for the...
-
ACCT2020-301 Class Project Lease vs. Buy - Capital Budgeting BACKGROUND ONE OF EVERY THREE NEW CARS ON THE ROAD is leased, and consumers are confronted frequently with the decision of whether to buy...
-
The Elements Corporation Soru 1. Elements is an upscale university housing complex providing all the amenities of private townhouse living, and a full service 24-hour cafeteria for busy students....
Study smarter with the SolutionInn App