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. (12x10x8=960.)

first, you should create a class named roomdimension that has two fields: one for the length of the room and one for the width. the roomdimension class should have a method that return the area of the room. (the area of the room is the rooms length multiplied by the rooms width.)

nest, you should create a roomcarpet class that has a roomdimension object as a field. it should also have a field for the cost of the carpet per square foot. the roomcarpet class should have a method that returns the total cost of the carpet.

figure 9-21 is a uml diagram that shows possible class designs and the relationships among the classes. 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 to 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 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
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
question
Computers and Technology, 26.01.2021 23:00
question
Mathematics, 26.01.2021 23:00
question
Physics, 26.01.2021 23:00
question
Mathematics, 26.01.2021 23:00
question
Mathematics, 26.01.2021 23:00