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....
-
Production Report Analysis: Prepare production reports under the weighted average as well as the FIFO method. What is the cost per bottle under each method? What is considered as normal and abnormal...
-
External and internal costs: a How do external and internal environmental costs differ? Provide three examples of an external, and four examples of an internal, environmental cost. In your examples...
-
A newly hired staff accountant prepared the pre-audit income statement of Be Fit Recreation Incorporated for the year ending December 31, 2011. The following information was obtained by Be Fits...
-
1. For the following questions assume E-30x10 psi, =0.3 (10) A. If a bar is subjected to a compressive stress of 110 ksi, what strain would be produced? B. If a bar is under an axial strain of +0.05,...
-
The following two graphs are both face-magic. Find one vertex labeling that induces a constant face labeling for each graph (there may be more than one, but just find one). a b)
-
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!...
-
The two main standardized tests in the United States for high school students are the ACT and SAT. ACT scores are normally distributed with mean 18 and standard deviation 6. SAT scores are normally...
-
Molly Ellen, bookkeeper for Keystone Company, forgot to send in the payroll taxes due on April 15. She sent the payment November 8. The IRS sent her a penalty charge of 9.60% simple interest on the...
-
2. A 110-gram block is attached to a 75.0-cm string and made to go around in circles at a constant rate of 108 rpm on a frictionless, horizontal table. a) What is the angular velocity in rad/s? b)...
-
Electric potential is measured at points A = ( - 2 , - 3 ) cm and B = ( 5 , - 4 ) cm . The measurements are VA = 9 V and VB = 3 6 V , respectively. The electric field points exclusively along the x -...
-
For a company named BRAND Burger targeting people from different nationalities by serving them burgers with taste and recipies from their country, going to be opened in BC Canada Make SWOT analysis....
-
The five-charge model below consists of the interaction between a molecule of oil, represented as two polarization charges, to the left, and a molecule of water, to the right. O H* H* 50 pm 100 pm 50...
-
What information is provided when you report the results of a related-samples t test?
-
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).
-
Compare Income Statements and Balance Sheets of Competitors a. Following are selected income statements from two pharmaceutical companies, Pfizer and Dr. Reddy's, for their respective 2018 fiscal...
-
Describe how the nuclear process compares to a similar chemical process in terms of energy ? what is the anatomical pathway and physical and chemical processes of a cookie. starting at the mouth and...
-
Sodium hydroxide is used extensively in acid-base titrationsbecause it is a strong, inexpensive base. A sodium hydroxidesolution was standardized by titrating 26.62 mL of 0.1007 Mstandard...
Study smarter with the SolutionInn App