Question: java code waterTax method calculates a water bill, the method gets a double and returns a double. The more water you use the more it

java code

waterTax method calculates a water bill, the method gets a double and returns a double.

The more water you use the more it will cost you (as a fine for wasting water).

for example:

waterTax(50) returns 30 waterTax(55) returns 49.5 waterTax(101) returns 140.9 waterTax(151)

returns 235.9 the regular calculation under 50 is bill = units * 0.60; above 50 is: bill = units * 0.90;

above 100 the calculation is like above 50 but with a 50 as fine

and above 150 its the same as above 50 (units *0.90) but with a 100 fine added to the price .

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!