[Solved] If Kilometer above 100 kilometer, pay 0.20 cent extra per kilometer [closed]


I’d suggest you to store the total price in a separate variable. That way, you can check for the totalKM value and add to that total price in that case:

decimal totalPrice = car * days;

if (totalKM > 100)
{
    totalPrice += totalKM * .2;
}

MessageBox.Show("De totale prijs wordt " + totalPrice + " euro");

2

solved If Kilometer above 100 kilometer, pay 0.20 cent extra per kilometer [closed]