Suppose Square1 is an object of the class Square and the statement Call Square1.ComputeArea() appears in the
Question:
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 ComputeArea()?
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% (6 reviews)
Set...View the full answer
Answered By
PALASH JHANWAR
I am a Chartered Accountant with AIR 45 in CA - IPCC. I am a Merit Holder ( B.Com ). The following is my educational details.
PLEASE ACCESS MY RESUME FROM THE FOLLOWING LINK: https://drive.google.com/file/d/1hYR1uch-ff6MRC_cDB07K6VqY9kQ3SFL/view?usp=sharing
3.80+
3+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
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...
-
A neutron star is an object of nuclear density. If our sun were to collapse to a neutron star, what would be the radius of that object?
-
Create an instance of the class Square and reference it with the name MySquare. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End Constructor...
-
Write a python program that reads a string S containing integers and prints the maximum number of toys Robert has to buy for Charlie . . Input : 5 1 2 2 4 5 1 2 2 4 Output : 3 3
-
List the translation accounting rules of the U.S.Standard FAS #52 "Foreign Currency Translation."
-
Asset management ratios are used to measure how effectively a firm manages its assets, by relating the amount a firm has invested in a particular type of asset (or group of assets) to the amount of...
-
Even if all the points on an x@chart fall between the control limits, the process may be out of control. Explain.
-
Scrap, job costing. The Morgan Company has an extensive job-costing facility that uses a variety of metals. Consider each requirement independently. Required 1. Job 372 uses a particular metal alloy...
-
The common stock of NCP paid $1.42 in dividends last year. Dividends are expected to grow at an annual rate of 9.00 percent for an indefinite number of years. a. If your require rate is 11.60...
-
?A solution was prepared by mixing 25.00 mL of 0.080 0 M aniline, 25.00 mL of 0.060 0 M sulfanilic acid, and 1.00 mL of 1.23 x10 -4 M HIn and then diluting to 100.0 mL. (HIn stands for protonated...
-
Give the names of the methods of the class Square. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End Constructor Public Subprogram SetSide...
-
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!...
-
Determine the range of velocities over which a bed of granite particles $\left(S G=3.5, \mathrm{a}_{\mathrm{s}}=0.012 \mu \mathrm{m}^{-1} ight.$, $\psi=0.8, \mathrm{~d}=0.6 / \mathrm{a}_{\mathrm{s}}$...
-
Coaching for Performance Develop a strategy for how you will approach the coaching session with the employee, including what you plan to discuss and any questions you may have when you debrief....
-
For the following exercises, find the derivatives of the given functions: 1. y=x-secx+1 2. y = 3 cscx+ 5 3. f(x) = x cotx 4. f(x) = secx I 5. y=
-
1. why does Amazon use ERP system? How does ERP system work for Amazon? what are the benefit and drawbacks of using ERP for Amazon? 2. what are 5 industry best practices across Finance,...
-
A rigid vessel contains afuel gasconsisting of a methane (CH4) and ethane (C2H6) mixture. The pressure in the vessel is found to be 0.30 bar.Air is added to the vessel until the total pressure...
-
Do you agree with this discussion post? My article discusses decision-making tools in Project Management (PM). "In research and development (R&D), project management (PM) decision-making tools are...
-
The Brum Corporation, a C corporation, is owned 100% by john Bean :ind had taxable income in 2019 of $500,000. John is also an employee of the corporation. In December 2019, the corporation has...
-
a) Calculate the goodwill that was paid by Major Ltd on the acquisition of Minor Ltd. [10 marks] b) Prepare the consolidated statement of financial position for Major Ltd at 31 July 20X8. [30 marks]...
-
Write a program to make the TCP client program in Table 25.4 more generic to be able to send any request created by the program. Table 25.4 Echo client program using TCP 1 / TCP echo client program 2...
-
Can a program written to use the services of UDP be run on a computer that has installed TCP as the only transport-layer protocol? Explain.
-
Write a method in Java to convert a 32-bit integer to a string representing an IP address in the form x.y.z.t.
-
Long-term liabilities are shown in two places in the business firm's balance sheet depending upon when the long-term liabilities are scheduled for payment. True False
-
Julio is single with 1 withholding allowance. He earned $1,025.00 during the most recent semimonthly pay period. He needs to decide between contributing 3% and $30 to his 401(k) plan. If he chooses...
-
Acquirer firm plans to launch a takeover of Target firm. The manager of Acquirer indicates that the deal will increase the free cash flow of the combined business by $13.6m per year forever. The beta...
Study smarter with the SolutionInn App