All pastes #344951 Raw Edit

Stuff

public text v1 · immutable
·published 2007-02-08 03:43 UTC
rendered paste body
//If-else for discountPercent
            if (discountPercent == 0) {
                if (total < 20)
                    discountPercent = total * 0.05;
                else if (total >= 25)
                    discountPercent = total * 0.10;
                else if (total >= 75)
                    discountPercent = total * 0.15;
                else if (total >= 120)
                    discountPercent = total * 0.20;
            }