vendredi 13 mars 2020

Cannot get esleif to return correct value

I have tried the following but cannot get it to work as it should.The first if works if area1 >=45 but if area1 = 41 or 42, it returns 15.25. Please help. Thank you.

if (area1 >= 45) {
    cost =(((area1 - 45)*0.144)+18.5);}
    else if (area1 = 41) {
    cost = 15.25;}
    else if (area1 = 42) {
    cost = 16; }
    else {
    cost = 10;
    }

Aucun commentaire:

Enregistrer un commentaire