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?
-
During the year, the price of British gilts (government bonds) went from 102 to 106, while paying a coupon of 9. At the same time, the exchange rate went from 1:$1.76 to 1:$1.62. What was the total...
-
In the past five years, there have been significant innovations in technology such as smartphones and tablets. Technology companies rely on intellectual property (IP) rights, such as patents,...
-
Karla Tanner opens a Web consulting business called Linkworks and completes the following transactions in its first month of operations. April 1 Tanner invests $80,000 cash along with office...
-
Cash Receipt Schemes and Other Asset Misappropriations, identify and describe two big data and data analytic techniques each for detecting skimming, cash larceny, and noncash misappropriations.
-
Use the data in MEAP00_01.RAW to answer this question. (i) Estimate the model mathA = (0 + (1 lunch + (2 log(enroll) + (3log(exppp) + u by OLS and obtain the usual standard errors and the fully...
-
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 mean birth length for U.S. children born at full term (after 40 weeks) is 52.2 cm (about 20.6 inches). Suppose the standard deviation is 2.5 cm and the distributions are unimodal and symmetric....
-
Do you think most people have a shared understanding of the definition of "ethics"? Share 1-2 examples to support your opinion. Looking back on your previous employers, have you experienced ethical...
-
Complete the following requirements: Describe the components of the common body of tax law (CBOTL). Include in your response answers to the following questions: * What role does the U.S. Congress...
-
Explain the common law system of precedent in the US (based on English law). Differences between common law versus civil law (used in other countries)
-
You are the CISO at 123 Stores Inc. Your department performs an annual risk assessment. Your greatest concern in relying on your department's peformance of the assessment in developing...
-
You deposit $100 each year for 5 years, and increase you deposit by $10 each year ( year 1=$100, Year 2=$110, Year 3= $120, Year 4=$130, Year 5=$140 in an account that earns 4% interest. Which value...
-
Use a derivation like that in Problem 25 to obtain a formula for the arithmetic sum. In problem 25 S = 1 + 2 + 3 + ... + (n-2) + (n-1) + n S = n+ (n-1) + (n-2) + ... + 3 + 2 + 1 I1 (a + kd) a+(a + d)...
-
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...
-
Is General Motors considered a flat organization? What structure does the GM organization have?
-
For this discussion, review specifically the growth and development in your own leadership skills, relative to project politics, ethics, and collaboration. What qualities and skills have you improved...
-
For this discussion, apply the skills and knowledge that you obtained from this week's reading. Use either an example of a real implementation of an agile project from your current employer, or a...
Study smarter with the SolutionInn App