Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Java COSC 2436 Lab 2 Instructions Carpet Calculator The Westfield Carpet Company has asked you to write an application that calculates the price of

image text in transcribed
image text in transcribed
Use Java
COSC 2436 Lab 2 Instructions 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 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 COM $960. (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 Room Dimension 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 Room Dimension 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. In addition to the above specs given please add the following methods in both classes: . Copy constructor toString() method clone() method equals() method compareTo() method finalize() method Once you have written these classes, use them in an application to test all methods you have created. Create at least three RoomCarpet objects and add them into an ArrayList Deliverables: Room Dimension.java (30 %) RoomCarpet.java (30%) Carpet CalculatorApp.java (30%) Screenshot(s)- 10%

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

Step: 3

blur-text-image

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

How would we like to see ourselves?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago