subject

The Westfield Carpet Company has asked you to write an application that calculates the price of carpeting for rectangular rooms. To calculate the price, you multiply the area of the floor (width times length) by the price per square foot of carpet. For example, the area of floor that is 12 feet long and 10 feet wide is 120 square feet. To cover that floor with carpet that costs $8 per square foot would cost $960. (12 × 10 × 8 = 960.) First, you should create a class named RoomDimension that has two FeetInches objects as attributes: one for the length of the room and one for the width. (You should use the version of the FeetInches class that you created in Programming Challenge 11 with the addition of a multiply member function. You can use this function to calculate the area of the room.) The RoomDimension class should have a member function that returns the area of the room as a FeetInches object. Next, you should create a RoomCarpet class that has a RoomDimension object as an attribute. It should also have an attribute for the cost of the carpet per square foot. The RoomCarpet class should have a member function that returns the total cost of the carpet. Once you have written these classes, use them in an application that asks the user to enter the dimensions of a room and the price per square foot of the desired carpeting. The application should display the total cost of the carpet.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, shimmerandshine1
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
image
Computers and Technology, 23.06.2019 08:00, leleee10
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
image
Computers and Technology, 23.06.2019 22:40, azariah7
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
image
Computers and Technology, 24.06.2019 03:30, mprjug6
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
Answers: 1
You know the right answer?
The Westfield Carpet Company has asked you to write an application that calculates the price of carp...

Questions in other subjects:

Konu
English, 14.12.2020 07:40
Konu
Mathematics, 14.12.2020 07:40
Konu
Business, 14.12.2020 07:40
Konu
Mathematics, 14.12.2020 07:40