Write a C++ code for task 2 according to given condition. Task # 02. Create a class
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a C++ code for task 2 according to given condition.
Transcribed Image Text:
Task # 02. Create a class Rectangle keeping in mind that rectangle have length and width. One should be able to calculate the perimeter () and the area () of the rectangle, can set a value to length and width and retrieve the value of Length & width. Where 0 < length < 21 0 < width < 21 Area of Rectangle-length*width; Perimeter of Rectangle = (length + width) *2; TEST PLANS Commands Output Rectangle r; r.set (2); r.getLength (); r.set (50); r.getLength (); Rectangle f=r3B f.set (-20); f.getLength (); Task # 02. Create a class Rectangle keeping in mind that rectangle have length and width. One should be able to calculate the perimeter () and the area () of the rectangle, can set a value to length and width and retrieve the value of Length & width. Where 0 < length < 21 0 < width < 21 Area of Rectangle-length*width; Perimeter of Rectangle = (length + width) *2; TEST PLANS Commands Output Rectangle r; r.set (2); r.getLength (); r.set (50); r.getLength (); Rectangle f=r3B f.set (-20); f.getLength ();
Expert Answer:
Answer rating: 100% (QA)
H include Liostream using names pa ce Std class Reckang le 1l class Rectang le 1219nd Re... View the full answer
Posted Date:
Students also viewed these programming questions
-
Write a C code for Insertion Sort Insert element into sorted list Given a sorted list with an unsorted number in the rightmost cell, can you write some simple code to insert into the array so that it...
-
Write a C code for Bubble Sort Given an array of integers, sort the array in ascending order using the Bubble Sort algorithm above. Once sorted, print the following three lines: 1. Array is sorted in...
-
Write a C code for this question. Recently Max has got himself into popular CCG "BrainStone". As "BrainStone" is a pretty intellectual game, Max has to solve numerous hard problems during the...
-
You have been asked to manage a $3 million university endowment fund, which is used to fund the additional salary stipend for 5 endowed chair positions. The stipend for each chair is $30,000 (for a...
-
Organizational Codes of Ethics A study of one major companys code of ethics by the Business Roundtable found that the lower the level of employees on the corporate ladder, the greater their hostility...
-
The required accounting for deferred taxes delays recognizing in net income the benefits and costs of temporary differences from the period when they originate to the period when they reverse....
-
The long, straight current-carrying wire of Figure P27.16 lies in the plane of the page, and the magnetic field it produces at position \(\mathrm{P}\) points out of the page. (a) In what direction...
-
Consider FASB standards for accounting for contributions and answer the following: a. Outline revenue recognition criteria for resources restricted for (1) Time and (2) Purpose. b. Describe the...
-
12. If the velocity-time graph has the shape AMB, what would be the shape of the corresponding acceleration-time graph? (A) a (B) (C) A (D) a A M B time(t)
-
The comparative balance sheet o f JSA Ltd. at June 30, 2018, is as follows: JSA Ltd.'s 2018 income statement is as follows: Required a. Calculate the various accruals on an item-by-item basis. For...
-
How much does a 25 kg concrete block weigh under water? (The density of concrete is 2300 kg/m)
-
What are the accounting period options for the following businesses? a. Ccorporation starting business on March 11 b. Sole proprietorship starting business on May 27 with a proprietor on the...
-
Jennifer uses the cash method. Which of the following transactions result in gross income in the current year? a. Car, worth $7,000, received as a consulting fee b. $500 of interest credited to her...
-
The Light Record Corporation has been on the calendar year since its inception five years ago. It wishes to change to an April 30 natural business year. For 2019, the calendar year of proposed...
-
Assume the same facts as the problem above except the premium is for coverage from August 1, 2019 to July 31, 2021. What is the largest deduction Wagner Co. can take in 2019? Data from in problem...
-
Jen Company decided to change its method of accounting from the cash basis to the accrual basis in 2019. Its taxable income for 2019 under the accrual basis was $250,000. It determined that the...
-
During January, its first month of operations, Sheridan Company accumulated the following manufacturing costs: raw materials purchased $5,200 on account, factory labor incurred $6,600, and factory...
-
Figure displays a 12.0 V battery 3 four uncharged capacitors of capacitances C1 = 4.00F, C2 = 6.00F, and C3 = 3.00F. The switch is thrown to the left side until capacitor 1 is fully charged. Then the...
-
Light of a single wavelength is incident on a diffraction grating with \(500 \mathrm{slits} / \mathrm{mm}\). Several bright fringes are observed on a screen behind the grating, including one at...
-
The shiny surface of a CD is imprinted with millions of tiny pits, arranged in a pattern of thousands of essentially concentric circles that act like a reflection grating when light shines on them....
-
If sunlight shines straight onto a peacock feather, the feather appears bright blue when viewed from \(15^{\circ}\) on either side of the incident beam of sunlight. The blue color is due to...
Study smarter with the SolutionInn App