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."
-
1. Describe how the Child Care Early Years Act (CCEYA) supports the principles that guide high-quality early learning care. 2. Upon completion of the CCEYA self-test, reflect on how this exercise...
-
Compare and contrast the following two statements. Are they concerned with achieving eco-efficiency, eco-effectiveness or both? 1 Businesses should sack the unproductive kilowatt-hours, tonnes and...
-
Medical Dispensary borrowed $390,000 on January 2, 2012, by issuing a 10% serial bond payable that must be paid in three equal annual installments plus interest for the year. The first payment of...
-
2. What is the effect (increase, decrease, no change) of each of the following processes or conditions on the matching property of a polycrystalline metal (circle your choice for each line) (4)...
-
For each of the following scenarios, indicate whether or not independence-related SEC rules are being violated, assuming that the audit entity is a public company. Briefly explain why or why not. a....
-
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!...
-
Sound Check, a merchandising company specializing in home computer speakers, budgets its monthly cost of goods sold to equal 70% of sales. Its inventory policy calls for ending inventory in each...
-
The budget director for Campbell Cleaning Services prepared the following list of expected selling and administrative expenses. All expenses requiring cash payments are paid for in the month incurred...
-
What is frictional unemployment ? 1.2 Provide examples of people who are experiencing or have experienced this kind of unemployment. 1.3 What causes it to increase? 1.4 How did COVID19 affect...
-
A company manufactures a single product. Budget and standard cost details for next year include: Selling price per unit RM100.00 Variable production cost per unit RM44.50 Fixed production costs...
-
List three ways you have seen people manage stakeholder engagement in academic or work environments. Which approach(s) seemed to work better? Why? (2) Why do you think PMI created a separate...
-
The text mentions that some people believe it is inappropriate to use rewards to regulate behavior, which is the essence of reinforcement theory. Do you agree with this criticism, why or why not? In...
-
Using the data listed in Question 15, In Q 15 Time 1 ______________ Time 2 4 .............................8 3 .............................2 5 .............................7 4...
-
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.
-
Presented below are the comparative income and retained earnings statements for Sunland Inc. for the years 2025 and 2026. 2026 2025 Sales $374,000 $268,000 Cost of sales 213,000 128,000 Gross profit...
-
What are the financial and operational implications of leverage buyouts and private equity takeovers on target companies, including capital structure and governance changes ?
-
How do environmental, social, and governance (ESG) criteria influence investment strategies, and what is their impact on portfolio diversification and risk-adjusted returns?
Study smarter with the SolutionInn App