subject

JAVA: Carpet Calculator

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 the floor that is 12 feet long and 10 feet wide is 120 square foot. To cover that floor with carpet that costs $8 per square foot would cost $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 of the room. The RoomDimension class should have a method that returns the area of the room.

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 calculates and returns the cost of the carpet.

Once you have the two classes, write a test program to ask the user to enter the dimensions of a room and the price per square foot of the desired carpeting. Then display the total cost of the carpet.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:30
The graph shows median weekly earnings for full-time workers according to education level. which can you not conclude?
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
You know the right answer?
JAVA: Carpet Calculator

The Westfield Carpet Company has asked you to write an applicat...
Questions
question
Mathematics, 05.03.2021 05:30
question
Mathematics, 05.03.2021 05:30
question
Arts, 05.03.2021 05:30
question
Mathematics, 05.03.2021 05:30
question
Mathematics, 05.03.2021 05:30
Questions on the website: 13722363