Question 97:
Given:
Your design requires that: ✑ fuelLevel of Engine must be greater than zero when the start() method is invoked. ✑ The code must terminate if fuelLevel of Engine is less than or equal to zero. Which code fragment should be added at line n1 to express this invariant condition?
Answer options:
A. assert (fuelLevel) : "Terminating"¦";
B. assert (fuelLevel > 0) : System.out.println ("Impossible fuel");
C. assert fuelLevel < 0: System.exit(0);
D. assert fuelLevel > 0: "Impossible fuel" ;