<<< Comparing Strings Examples | Index | The while loop >>> |
An if statement with else-if and else clauses:
if ( customerType.equals( "T" ) ) { discountPercent = .4; } else if ( customerType.equals( "C" ) ) { discountPercent = .2; } else if ( subtotal >= 100 ) { discountPercent = .2; } else { discountPercent = .1; }
<<< Comparing Strings Examples | Index | The while loop >>> |