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. The Room Dimension class should have a member function that returns the area of the room as a FeetInches object. Next, you should create a Room Carpet 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 Room Carpet 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: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
Your boss wants you to configure his laptop so that he can access the company network when he is on the road. you suggest a vpn connection to him. he is very concerned about security and asks you how secure vpn is. what do you tell him?
Answers: 1
question
Computers and Technology, 22.06.2019 21:50
Answer the following questions regarding your system by using the commands listed in this chapter. for each question, write the command you used to obtain the answer. a. what are the total number of inodes in the root filesystem? how many are currently utilized? how many are available for use? b. what filesystems are currently mounted on your system? c. what filesystems are available to be mounted on your system? d. what filesystems will be automatically mounted at boot time?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
question
Computers and Technology, 23.06.2019 04:40
The narrative structure of the popular movies can be broken down into
Answers: 3
You know the right answer?
The Westfield Carpet Company has asked you to write an application that calculates the price of carp...
Questions
question
Mathematics, 26.04.2021 23:30
question
Mathematics, 26.04.2021 23:30
question
Social Studies, 26.04.2021 23:30
question
Mathematics, 26.04.2021 23:30
Questions on the website: 13722360