Mutator returning a value
Add a new method emptyMachine() to the TicketMachine class that is designed to simulate emptying the machine of money It should both return the value in total and reset the value of total to zero. Paste the whole method into the space below
public int emptyMachine()
{
System.out.println("# " + total );
total = 0;
}
i get this error:
TicketMachine.java:44: missing return statement
}
^
1 error
The output should have been:
emptyMachine() returns correct value
emptyMachine() empties machine
This is what was actually produced:
Exception in thread "main" java.lang.NoClassDefFoundError: TicketMachine