Missing Return Statement Error Basic Program

here:

public double reFuel()
    //refueling each ship returns it to its full fuel capacity
    {
        fuelCurrent = fuelCapacity;
    }

and here:

//prints out the fuel consumed for each ship in the fleet
    public double printSummary()
    //prints out fuelConsumed for each ship
    {
    System.out.println(ship1.getName() +" 's total fuel consumption is " + ship1.getFuelConsumed());
    System.out.println(ship2.getName() +" 's total fuel consumption is " + ship2.getFuelConsumed());
    System.out.println(ship3.getName() +" 's total fuel consumption is " + ship3.getFuelConsumed());
    System.out.println(ship3.getName() +" 's total fuel consumption is " + ship4.getFuelConsumed());
   }

You have two methods, you have said that they will return double but in their body there is no return A_DOUBE. fix them with adding return statement or just make them void depends on your problem.

Leave a Comment