Create an instance of the class, Rectangle and reference it with the name MyRectangle. Class Square Declare
Question:
Create an instance of the class, Rectangle and reference it with the name MyRectangle.
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: 40% (10 reviews)
Declare ...View the full answer
Answered By
Aysha Ali
my name is ayesha ali. i have done my matriculation in science topics with a+ . then i got admission in the field of computer science and technology in punjab college, lahore. i have passed my final examination of college with a+ also. after that, i got admission in the biggest university of pakistan which is university of the punjab. i am studying business and information technology in my university. i always stand first in my class. i am very brilliant client. my experts always appreciate my work. my projects are very popular in my university because i always complete my work with extreme devotion. i have a great knowledge about all major science topics. science topics always remain my favorite topics. i am also a home expert. i teach many clients at my home ranging from pre-school level to university level. my clients always show excellent result. i am expert in writing essays, reports, speeches, researches and all type of projects. i also have a vast knowledge about business, marketing, cost accounting and finance. i am also expert in making presentations on powerpoint and microsoft word. if you need any sort of help in any topic, please dont hesitate to consult with me. i will provide you the best work at a very reasonable price. i am quality oriented and i have 5 year experience in the following field.
matriculation in science topics; inter in computer science; bachelors in business and information technology
_embed src=http://www.clocklink.com/clocks/0018-orange.swf?timezone=usa_albany& width=200 height=200 wmode=transparent type=application/x-shockwave-flash_
4.40+
11+ Reviews
14+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
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...
-
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...
-
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...
-
On March 19, Modern Kitchens, a retail store, received Credit Memorandum 244 for $4,290 from J & M Appliance Corporation. The credit memorandum covered a return of damaged trash compactors originally...
-
What five steps are involved in estimating the impact of exchange rate changes on the value of the firm's real assets or on the value of equity?
-
You are the customer for a twelve-month project. You have team meetings scheduled with your subcontractor on a monthly basis. The contract has a contractual requirement to prepare a twenty-five- to...
-
A company starts business on 1 January. In that month it buys 300 grecks at 40 each, then 200 at 50 each. On the last day of the month it sells 400 grecks. If it uses FIFO to value stock, what is the...
-
An investor purchases a stock for $38 and a put for $.50 with a strike price of $35. The investor sells a call for $.50 with a strike price of $40. What is the maximum profit and loss for this...
-
Evaluate the integral. Assume that A is a real number and that A < 0. 0 L 3 dx (x-3)3
-
You are considering a 10-year investment project. At present, the expected cash flow each year is $10,000. Suppose, however, that each years cash flow is normally distributed with mean equal to last...
-
List all methods of an object in the class Rectangle. 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 MyRectangle equal to 15 and the height equal to 25. Class Square Declare Protected Side, Area As Float...
-
The Garrett Corporation paid $200,000 to acquire land, buildings, and equipment. At the time of acquisition, the company paid $20,000 for an appraisal, which revealed the following values: land,...
-
You have an account with annual interest rate 6% compounded monthly. You will deposit $120 at the end of each month for 10 years into this account, leave the account untouched for 5 years, and then...
-
Assume that you have just started business as an actuarial consultant and are faced with two choices in terms of long term, full-time contracts. (If you take one, you cannot take the other). a. The...
-
A company issues zero coupon bonds which mature in 30 years. These bonds can be bought for $99.38 and then pay no annual interest payments, only $1000 at maturity. What is the annual percentage cost...
-
A group of thirty-nine people is selected at random. What is the probability that at least two of them will have the same birthday? (Round your answer to four decimal places.)
-
What variables to consider to carry out the Dupont method in finance? Explain.
-
Describe the role of leadership in creating a learning organization culture.
-
Define relevant costs and discuss: (1) whether all future costs are relevant for decision making and (2) whether variable costs are always relevant and fixed costs are always irrelevant
-
Alice has been on a long trip without checking her e-mail. She then finds out that she has lost some e-mails or attachments her friends claim they have sent to her. What can be the problem?
-
In FTP, assume a client with user name John needs to store a video clip called video2 on the directory /top/videos/general on the server. Show the commands and responses exchanged between the client...
-
In Figure 26.13 in the text, what is the difference between the MAIL FROM in the envelope and the FROM in the header? Figure 26.13 Figure 26.13 Format of an e-mail Behrouz Forouzan 20122 Olive Street...
-
For Questions 5 and 6 refer to the following information Subgrade Width Station 0+000 centerline top of subgrade elevation Highway vertical grade from 12.0m 867.000m -1.50% Station 0+000 Horizontal...
-
Given the following data for a company: Sales Revenue $36,000 Cost of goods sold 24,080 Gross profit 11,920 Operating expenses 7,120 Net income $4,800 How would cost of goods sold appear on a common...
-
Low Carbohydrate Low Fat Mediterranean Mean -2.9269 -3.1423 -5.4654 Median -2.9500 -3.4000 -5.8500 Standard Deviation 2.02436 2.49835 2.36439 Variance 4.098 6.242 5.590 Minimum -8.50 -7.90 -9.20...
Study smarter with the SolutionInn App