Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3 Answer question Q3(a) - Q3(h) based on the information given in Figure Q3. A building surveyor has assigned you to write an application that
3 Answer question Q3(a) - Q3(h) based on the information given in Figure Q3. A building surveyor has assigned you to write an application that calculates the total labour cost of bullding a cylinder water tank for an office building. To calculate the labour cost, you multiply metre of tank. For example, the volume of tank with 10 metres radius and 15 metres height is 4,710 cubic metres. To build the tank with labour cost of RM20 per cubic metre would result in total labour cost of RM94,200.00 (20.004,710). First, you should create a class named CylinderTank that has two fields: one for the radius of the tank and one for the height of the tank. The CylinderTank class should have a method that returns the volume of the tank. Next, you should create a WaterTank class that has a CylinderTank object as a field. It should also have a field for the cost of the labour per cubic metre. The WaterTank class should have a method called findTotallabourcost() that returns the total labour cost for building the tank. The following diagram shows possible class design and depicts the relationship between the WaterTank and CylinderTank classes. (a) Declare data field(s) for cylindertank. (b) Write a constructor with argument(s) for cylindertank. (c) Write getradius () method. (d) Write getheight () method. (e) Write getvolume () method. Assume that the value of is equal to 3.14. (f) Declare data field(s) for waterTank. (g) Write a constructor with argument(s) for waterTank. (h) Write findTotallabourcost() method
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