Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help, I dont understand how to do this for my java programming class. Comment any method used and also use header comment Carpet Project

Please help, I dont understand how to do this for my java programming class. Comment any method used and also use header comment Carpet Project 1 image text in transcribed
Carpet Calculator The Westield Carpet Company has asked you to write an application that calculates the price of carpeting for rectangular rooms. To caiculate the price, you multiply the area of the foor (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 S960. (12 X 10 X 8 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 returns the area of the room. (The area of the room is the room's length multiplied by the room's width.) Next 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 8-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 pnce per square foot of the desired carpeting The application should display the total cost of the carpet

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

Which diagnostic test is most commonly used to confirm PROM?

Answered: 1 week ago

Question

What is the hallmark clinical feature of a molar pregnancy?

Answered: 1 week ago

Question

outline some of the current issues facing HR managers

Answered: 1 week ago