vendredi 23 janvier 2015

Hi, how do I return 110 here? 'car1.getCostOfTrip();' always returns 100 (its initial state). Thank you

private int distance; private int cost;


distance = totalDistance; cost = totalCost;


public void newCostOfTrip(int newCostOfTrip)



if (getTotalDistance() >= 100) //true or false
{
setCostOfTrip(newCostOfTrip+(newCostOfTrip/100*10));
}

Aucun commentaire:

Enregistrer un commentaire