Create an instance of the class Square and reference it with the name MySquare. Class Square Declare
Question:
Create an instance of the class Square and reference it with the name MySquare.
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: 83% (6 reviews)
Declar...View the full answer
Answered By
Charles mwangi
I am a postgraduate in chemistry (Industrial chemistry with management),with writing experience for more than 3 years.I have specialized in content development,questions,term papers and assignments.Majoring in chemistry,information science,management,human resource management,accounting,business law,marketing,psychology,excl expert ,education and engineering.I have tutored in other different platforms where my DNA includes three key aspects i.e,quality papers,timely and free from any academic malpractices.I frequently engage clients in each and every step to ensure quality service delivery.This is to ensure sustainability of the tutoring aspects as well as the credibility of the platform.
4.30+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Create an instance of the class, Rectangle and reference it with the name MyRectangle. Class Square Declare Protected Side, Area As Float Public Square() Set Side 1.0 %3! Set Area = 1.0 End...
-
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...
-
Suppose that the vertices for an instance of the traveling-salesman problem are points in the plane and that the cost c (u, ) is the euclidean distance between points u and . Show that an optimal...
-
Mr. and Mrs. Thomas are buying a new house for $330,000. Compare the two loan offers by finding the monthly payments for each and calculating the total amount paid for each. Loan Options Down Payment...
-
Copper Kettle, Inc of the United States manufactures (what else?) copper kettles. Copper Kettle imports its raw materials from Chile, and sells most of its goods in the domestic United States....
-
A 5.00 g charged insulating ball hangs on a 30.0 cm long string in a uniform horizontal electric field as shown in Figure 18.52. Given the charge on the ball is 1.00 C, find the strength of the...
-
Reproduce Figure 2.4 using geom_histogram(aes(y = ..density..)) as shown below for Example 2.5. ggplot_build() extracts the computed values for the histogram. Use the extracted vales to confirm that...
-
Return on investment ( ROI) is computed in the fol-lowing manner: ROI is equal to turnover multiplied by earnings as a percent of sales. Turnover is sales divided by total investment. Total...
-
a) Boston Computers factors $850,000 of receivables to Safety Factors, Inc. Safety Factors assesses a 3.5% service charge on the amount of receivables sold. b) Limeade Boutique accepted a Visa card...
-
Read the following Retail Store Case Study. "Ragland Department Store is located in the heart of a small community. The store has been in business for many years with profitable operations until...
-
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...
-
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!...
-
Below is a variable costing income statement for the Wilner Glass Company, a maker of bottles for the beverage industry. For the coming year, the company is considering hiring two additional sales...
-
Define, and explain the use of, return on investment as a measure of divisional performance.
-
How do the managers of a business maintain its competitive position ?
-
What is the profitability index?
-
Hilarious take on high school in the land of Twitter, texting, and YouTube. Emma Stone, in a stunningly sharp depiction, plays a high schooler who begins to act out the Scarlet Letter, the famous...
-
In what circumstances can groups become too open? Too closed?
-
Midwest Manufacturing purchased a three-year insurance policy for $30,000 on January 2, 2012. Prepare any journal entries, adjusting journal entries, and closing journal entries required on January...
-
7. Baladna wants to analyze process that includes delivery by suppliers, production inside the company, transportation to to its customers and information systems. Then it also wants to find out...
-
Modify, compile, and test the client program in Table 25.17 and the server program in Table 25.16 to allow the client to provide the pathname of a short file stored on the server host. The server...
-
A new application is to be designed using the client-server paradigm. If only small messages need to be exchanged between the client and the server without concern for message loss or corruption,...
-
Write a method in Java to extract the IP address (without the prefix) as a string in dotted-decimal notation from a string representing the CIDR notation (x.y.z.t/n).
-
Design a power transmission system to connect a DC motor to its load. The motor is given in the motor catalogue as a BM1400 motor. You must create a transmission which will connect to this motor and...
-
SDJ, Incorporated, has net working capital of $3,320, current liabilities of $4,550, and inventory of $4,600. a. What is the current ratio? b. What is the quick ratio?
-
Calculate the final selling price to the nearest cent and markdown percent to the nearest hundredth percent: Original selling price $4,900 First markdown 20% Second markdown 10% Markup 12% Final...
Study smarter with the SolutionInn App