Write the statement that would be used in the main program to compute the area of MyRectangle.
Question:
Write the statement that would be used in the main program to compute the area of MyRectangle.
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: 70% (10 reviews)
Answered By
Muhammad Haroon
More than 3 years experience in teaching undergraduate and graduate level courses which includes Object Oriented Programming, Data Structures, Algorithms, Database Systems, Theory of Automata, Theory of Computation, Database Administration, Web Technologies etc.
5.00+
3+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Determine the critical values that would be used in testing each of the following null hypotheses using the classical approach. Ho: Ho: Ho: 0 vs. Ha: 0, with n 18 and 0 vs. Ha: > 0, with n 32...
-
a. Measure all the voltages and currents indicated. - Note that elements are connected in parallel. Follow best practices covered in the lecture for parallel connection of elements to one point. b....
-
Determine the bounds on the p-value that would be used in testing each of the following null hypotheses using the p-value approach: Ho: Ho: Ho: 0 vs. Ha: 0, with n :-32 and r 0.41 0 vs. Ha: > 0,...
-
The combined sewer system in city ABC is comprised of two parallel interceptors referred to as "North" and "South" lines. The southern line is connected to a newly built wastewater treatment plant....
-
You work for an Argentinian importer and expect to pay 1 million in one year to a European supplier. You can trade at the following prices: Spot rate, Argentinean australs per euro AA24.38/ One-year...
-
(a) How strong is the attractive force between a glass rod with a 0.700 C charge and a silk cloth with a-0.600 C charge, which are 12.0 cm apart, using the approximation that they act like point...
-
Suppose you are asked to design a study to evaluate the effect of the presence of vending machines in schools on childhood obesity. Describe randomized and non-randomized studies to evaluate this...
-
The image of a tree just covers the length of a plane mirror 4.00 cm tall when the mirror is held 35.0 cm from the eye. The tree is 28.0 m from the mirror. What is its height?
-
A Corporation has purchased 1 , 0 0 0 shares of it s own common stock for $ 2 5 per share. The corporation later sells 5 0 0 shares of this treasury stock for $ 2 8 per share. Complete the journal...
-
THE SHOPPES AT RIVERSIDE Fonda L. Carter, Columbus State University Kirk Heriot, Columbus State University CASE DESCRIPTION This case asks the students to recommend a decision to a group of...
-
Write the statement that would be used in the main program to set the length of the side of MyRectangle equal to 15 and the height equal to 25. Class Square Declare Protected Side, Area As Float...
-
Write the statement that would be used in the main program to display the area of MyRectangle. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End...
-
Explain how the Hausman-Taylor estimator can be used to obtain consistent estimates of coefficients of time-invariant variables in a random effects model.
-
How are the task and social dimensions integral to both the formation and development of decision-making groups?
-
Why is profit not a suitable measure of divisional performance?
-
This is a Steven Spielberg dramatization of the famous Pentagon Papers case that pitted the Washington Post and the New York Times against the governments attempt to prevent release of damaging...
-
What is the ripple effect and how does it affect groups?
-
What have researchers found about the idea that different types of business have different types of working capital?
-
Starting in May 2013, Nicole has decided that she has everything that she needs to open her doors to customers. To keep up with competition, Nicole has added gift certificates and has started to...
-
A business had revenues of $280,000 and operating expenses of $315,000. Did the business (a) Incur a net loss (b) Realize net income?
-
Both HTTP and FTP can retrieve a file from a server. Which protocol should we use to download a file?
-
Using RFC 1939, assume a POP3 client is in the download-and-delete mode. Show the transaction between the client and the server if the client has only two messages of 230 and 400 bytes to download...
-
Assume we need to download an audio using FTP. What file type should we specify in our command?
-
Excerpts from Andre Company's December 31, 2024 and 2023, financial statements are presented below: Accounts receivable Inventory Net sales Cost of goods sold Total assets Net income Total...
-
The York City Hospital has just acquired new equipment. The equipment cost $ 4 , 2 5 0 , 0 0 0 , and the organization spent $ 1 3 5 , 0 0 0 on upgrading the physical plant to the new equipment will...
-
Calculate the following showing all the necessary steps: Note: CPP rate to be used in the calculation is 5.95%. Note: Don't forget to deduct pay period exemption\ \ Tanya earns $25.00 per hour. This...
Study smarter with the SolutionInn App