Question: Write a class named WallDimension that has two fields: one for the length of the wall and one for the width. The WallDimension class should

 Write a class named WallDimension that has two fields: one for
Write a class named WallDimension that has two fields: one for the length of the wall and one for the width. The WallDimension class should have a
method that returns the area of the wall. The area of the wall is the walls length multiplied by the walls width.

314 130% Q2 Answer Q2(a)-Q2(c) using Java based on the information given in FIGURE Q2. The BinaPaint Company has asked you to write a program that calculates the price of painting for rectangular walls. To calculate the price, you multiply the area of the wall (length times width) by the price per square metre of wall. For example, the area of wall that is 15 metres long and 12 metres wide is 180 square metres. To paint that wall that costs RM20 per square metre would cost RM3,600.00 (15x12x20 = 3,600) You are required to apply three classes: WallDimension, WallPaint, and PaintCalculator. The PaintCalculator contains the main method that will apply WallDimension and WallPaint classes. The following UML diagram shows possible class design and the relationships between the Wall Dimension class and WallPaint class. WallPaint size: WallDimension - paintCost: double +WallPaint (dim: WallDimension, cost: double) +get TotalCost(): double +toString(): String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!