1. Engineering
  2. Computer Science
  3. create a c class that is called carpet it contains...

Question: create a c class that is called carpet it contains...

Question details

create a c# class that is called carpet it contains the following private data fields width, length, area, and price.
Create the needed public properties for these data fields. Note that the area needs to be adjusted when modifying the length or the width. Add and overload operator (+) to add two carpets. When two carpets are added to each other a third carpet will be returned, the price of the third carpet is the price of the first carpet added to the price of the second one. The area of the third carpet is the area of the first carpet added to the second one, the length and width will equal -1.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution