Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lesson;
- public class MultipleConditionalStatments
- {
- public static void main(String[] args)
- {
- //sample 1
- //program checks if saleAmt>50k, assigns 500.00 to bonus, 0.12 to commission and 1 to daysOff
- //
- double salesAmt = 55_000, bonus = 0, commission = 0;
- int daysOff = 0;
- if (salesAmt > 50_000);
- {
- bonus = bonus + 500.00;
- commission = commission + .12;
- daysOff += 1; // same as: daysOff = daysOff +1;
- }
- //sample 2
- int avg = 96;
- boolean high = false;
- if (avg > 95)
- {
- high = true;
- }
- if (high) // if true it'll execute if not it wont
- {
- System.out.println("thats a high score");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement