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, 21.06.2019 19:00
Jill wants to become a network professional. which certification would be useful for her? a. mcse b. pmp c. comptia a+ d. ccie
Answers: 2
question
Computers and Technology, 21.06.2019 22:30
Provide an example of a project that combines the three principles of lean six sigma with business project management (bpm) and services oriented architecture (soa). identify the elements of the project that comply with each of three principles.
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
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
Chemistry, 29.01.2020 10:47
question
Mathematics, 29.01.2020 10:47
question
Mathematics, 29.01.2020 10:47
Questions on the website: 13722363