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: 88% (9 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....
-
938 Example 7.5. In the table below, the values of y are consecutive terms of a series of which 23.6 is the 6th term. Find the first and tenth terms of the series : 4 5 6 7 8 9 4.8 8.4 14:5 23.6 36.2...
-
Use the six pattern-analysis rules described in Figure
-
The following transactions occurred during March 2013 for the Wainwright Corporation. The company owns and operates a wholesale warehouse. [These are the same transactions analyzed in Exercise 21,...
-
Required information [The following information applies to the questions displayed below) At the beginning of Year 2, Oak Consulting had the following normal balances in its accounts Account Balance...
-
Twelve different message signals, each with a bandwidth of 10 kHz, are to be multiplexed and transmitted. Determine the minimum bandwidth required for each method if the multiplexing/modulation...
-
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!...
-
Train cars are coupled together by being bumped into one another. Suppose two loaded train cars are moving toward one another, the first having a mass of 150,000 kg and a velocity of 0.300 m/s, and...
-
Companies that engage international business do so in pursuit of a broad range of goals. Nonetheless, the text identifies key drivers, noting that the typical company expands operations...
-
How do lifestyle changes, such as urbanization or an aging population, affect consumer needs and preferences in our industry?
-
Verify that the following general thermodynamic property relationships are valid for the specific case of an ideal gas: (a) T = au (b) P = -9) av
-
Performance management systems that do not make true contribution to the organizational goals are not true performance management systems. List and describe at least five contributions a good...
-
How do cognitive biases, such as confirmation bias and anchoring, influence strategic decision-making processes at the executive level, and what measures can be implemented to mitigate their impact ?
-
Create and test an HTML document that describes an ordered list of your five favorite movies.
-
Explain the buyers position in a typical negotiation for a business. Explain the sellers position. What tips would you offer a buyer about to begin negotiating the purchase of a business?
-
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).
-
Given that rJ = 6.3%, rRF = 4.1%, and rM = 9.4%, determine the beta coefficient for Stock J that is consistent with equilibrium.
-
Simon Companys year-end balance sheets follow. At December 31 2017 2016 2015 Assets Cash $ 33,019 $ 37,839 $ 38,623 Accounts receivable, net 93,822 65,556 54,152 Merchandise inventory 117,963 89,253...
-
PLEASE REFER TO THE 2018 ANNUAL REPORT OF STARBUKS FOR THE YEAR FISCAL YR 2018, ENDING SEPTEMBER 30, 2018. Refer to the management discussion & analysis section and write a one page summary...
Study smarter with the SolutionInn App