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."
-
Nissan produces a car that sells in Japan for 1.8 million. On September 1, the beginning of the model year, the exchange rate is 150:$1. Consequently, Nissan sets the U.S. sticker price at $12,000....
-
Zappos.com is a popular website known mainly for its discounted shoe sales. In 2012, a hacker hacked into the Zappos website in an effort to obtain the personal account information of Zappos...
-
NPV, Relevant costs, Income taxes Phish Corporation is the largest manufacturer and distributor of novelty ice creams across the East Coast. The companys products, because of their perishable nature,...
-
Use conversion algorithm to convert ER diagram to Relational Model Or All ER to relational model intermediatory conversion steps with final relational model (i.e. step 4) RUberID REmail Passwd...
-
The fin shown in Figure P3-56 has a base maintained at 300ºC and is exposed to the convection environment indicated. Calculate the steady-state temperatures of the nodes shown and the heat loss...
-
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!...
-
What is the potential 0.530 x 10 -10 m from a proton (the average distance between the proton and electron in a hydrogen atom)?
-
In 2024, Cici, a physician who is 55 years old, brought in $200,000 before taxes. In ten years, she intends to leave her current position to launch her own company. Cici plans to open new TFSA, RRSP,...
-
Motivations for investing in the futures market includes all of the following EXCEPT speculation. hedging a current holding against the risk of an adverse price change. the creation of a portfolio...
-
US company has $10 million dollars it wants to invest for three months. Instead of investing in the US where the company can earn 4 percent on the funds, the company decides to open a money market...
-
Many people experience hearing loss, and GPS Marketers was hired to design a marketing campaign for a company that developed affordable hearing aids that boosted voices over background noises. The...
-
The most recent financial statements for Martin, Inc., are shown here: Income Statement Sales $28,000 Costs -16,800 Taxable income $11,200 Taxes (21%) -2,352 Net income $8,848 Assets Balance Sheet...
-
Based on your response to parts (a) and (b) of problem 34 make a conjecture about the variance of n identical numbers prove your conjecture.
-
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.
-
Suppose there is no corporate tax. The firm is the same firm in parts a) and b) of this problem. The firm's weighted average cost of capital is 15%. a) (1 point) Suppose that the cost of equity is...
-
A cooperative has voted to purchase a box truck to move produce to their distribution center. The new truck will cost $24,000. The marginal tax rate is 15%, inflation is 2.5% and the required rate of...
-
Shareholder rights advocates and proxy advisors are very critical about violations of the "one-share-one-vote" principle. What are potential (incentive) problems of dual-class share (and pyramid)...
How To Land A Top Paying Macroeconomics Professors Job 1st Edition - ISBN: 9781486122783 - Free Book
Study smarter with the SolutionInn App