Question 2 Classes and Objects [16 marks All questions in this section relate to the following class definition: class FuelTank private double capacity; private double currentLevel; public void setCapacity (double c) { Math.max (0, c) capacity 6 7 public double getCapacity ( return capacity 10 } 11 12 public double getCurrentLevel () 13 return currentLevel; 14 } 16 public FuelTank ( double c) 17 setCapacity (c); rrentLevel c; //initially tank is full 18 cur = C 19 20 21 consume (double quantity) public void 22 Math.max (0, currentLevel currentLevel 23 quantity) } 24 2 public boolean isEmpty 26 0; return current Level 27 28 29 d. (4 marks) (You need NOT have completed tasks a. b. OR c. in order to attempt this part) Consider the following client code and add a few lines of code in place of the comment //WRITE YOUR CODE HERE that computes the number of empty tanks and displays it in the console import java.util. Random; Client f public class public static void main (String [] args) FuelTank ] tanks = new FuelTank [100] ; new Random (); Random rand for (int i-0; i

"Get 15% discount on your first 3 orders with us"
Use the following coupon
"FIRST15"

Order Now