Question
[JAVA] Tile Floor The Tile Floors Corp has request to program a software that calculates the price of tiles for rectangular areas. Multiply the area
[JAVA]
Tile Floor The Tile Floors Corp has request to program a software that calculates the price of tiles for rectangular areas. Multiply the area of the floor by the price per square foot of tile to calculate the price. For example, if the area of floor that is 10 feet long by 5 feet wide is 50 square feet. To tile that area that costs $3 per square foot would cost $150. (10x5x3=$150.)
This program has these classes:
RoomSize
o Contains a field for the rooms length and one for its width T
o Contains a method that return the area of the room. (Rooms length multiplied by width.)
RoomTile o Contains a RoomSize object as a field.
o Contains a field for the cost of the tile per square foot.
o Contains a method that returns the total cost of the tile.
Room
o Contains a RoomTile object as a field
o Contains a field called roomName
o Contains a method called compareRoomNames that compares two instances of the class Room, and returns the Boolean value true if they have the same name, false if they do not
In your driver class, complete the program by creating a first set of appropriate objects. Ask the user to enter the name of the first room they want to appraise (e.g. living room). Next, ask the user to enter the rooms dimensions and the price per square foot to the desired tile.The application should then display the total cost to place the tile in the room. Next, repeat the operation, but for a second room. Ask the user to enter the name of the second room they want to appraise (e.g. bed room).
Next, ask the user to enter the rooms dimensions and the price per square foot to the desired tile. The application should then display the total cost to place the tile in the room. Finally, use the compareRoomNames method to compare the first rooms name with the second. Show the result on the screen with an appropriate message.
Remember to copy your object(s) when sending them as parameter(s) to instantiate others to preserve encapsulation as shown in class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started