Menu

[Solved] C Westfield Carpet Company Asked Write Application Calculates Price Carpeting Rectangular Q37258609

C++

The Westfield Carpet Company has asked you to write anapplication that calculates the price of carpeting for rectangularrooms. To calculate the price, you multiply the area of the floor(width times length) by the price per square foot of carpet. Forexample, the area of floor that is 12 feet long and 10 feet wide is120 square feet. To cover that floor with carpet that costs $8 persquare foot would cost $960.(12 x10 x 8 = 960.)

First, you should create a class named RoomDimension that hastwo FeetInches objects as attributes: one for the length of theroom and one for the width. (You should use the version of theFeetInches class that you created in Programming Challenge 11 withthe addition of a multiply member function. You can use thisfunction to calcu-late the area of the room.) The RoomDimensionclass should have a member function that returns the area of theroom as a FeetInches object.

Next, you should create a RoomCarpet class that has aRoomDimension object as an attribute. It should also have anattribute for the cost of the carpet per square foot. TheRoomCarpet class should have a member function that returns thetotal cost of the carpet.

Expert Answer


Answer to C++ The Westfield Carpet Company has asked you to write an application that calculates the price of carpeting for rectan… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *