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 03:20
Which of these is a benefit of social networking? oa. hiding your true identity from friendsob. avoiding talking to people in personoc. spending time with friends instead of studyingod. connecting with new people
Answers: 2
question
Computers and Technology, 23.06.2019 21:40
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
question
Computers and Technology, 24.06.2019 00:50
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
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
Business, 18.03.2021 23:00
question
Mathematics, 18.03.2021 23:00
question
Mathematics, 18.03.2021 23:00
question
Physics, 18.03.2021 23:00
Questions on the website: 13722362