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."
-
Should a project manager encourage the flow of problems to him? If yes, should he be selective in which ones to resolve?
-
(Payback, ARR, NPV) Tropic Investments is considering a project involving an initial cash outlay for an asset of $200,000. The asset is depreciated over five years at 20% per year (based on the value...
-
Quigley Inc. is considering two financial plans for the coming year. Management expects sales to be $301,770, operating costs to be $266,545, assets to be $200,000, and its tax rate to be 35%. Under...
-
Page 1: 1 2 3 - A company has a product that is split-off to create two separate products (Product X and Product Y). The company uses the physical measure method for allocating costs incurred prior...
-
Determine Vo and ID for the networks of Fig. 2.153. Si 0 10 mA 2.2 k 6.8 k Si
-
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!...
-
Read each of the given problems and then select the best of the given answers in Problems 329. In Karls math class with 28 students, 1/7 are receiving an A grade, 1/4 are Bs, 11 are Cs, and the rest...
-
Custom Backpacks started and finished job number D46, a batch of 100 backpacks, during July. The job required $2850 of direct material and 25 hours of direct labour at $25 per hour. The predetermined...
-
what indexing method calculates returns by taking readings daily, monthly or yearly depending on the policy contract rather than using the actual value of the index on a specific date.
-
The storage room has 5 cans of pineapple to begin, 6 was purchased and delivered and there are 4 cans left. each is worth $14. what is the usage value? Please show with formula.
-
Comment on the following statement from a plant manager: Meetings with my plant accountant are frustrating. All he wants to do is blame someone else for the various variations he reports. How can the...
-
Examine Gap's external environment. Where can you identify new opportunities? Should Gap venture into new markets? If yes, which markets should they consider, and how should they approach them? Are...
-
Potassium iodide (KI) exhibits predominantly ionic bonding. The K+ and I-ions have electron structures that are identical to which two inert gases?
-
Describe a group you belong or have belonged discuss the stages of group development and suggest how to improve the group effectiveness by using the group development model.
-
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.
-
Telford Co. presented net income of $ 240,000, preferred dividends of $ 60,000 and common stock of 90,000 shares. The company also had $ 100,000 of convertible bonds. The bonds paid interest of $...
-
Wendell's Hot Sauce uses a process costing system to determine its product's cost. The last of the three processes is packaging. The Packaging Department reported the following information for the...
-
Consider the following data for two products of Gitano Manufacturing. (Round your intermediate calculations and OH rate and cost per unit answers to 2 decimal places) Number of units produced Direct...
Study smarter with the SolutionInn App