System.out.println("Enter size box you want"); int boxSize = scan.nextInt(); double price; if (boxSize == 10) { System.out.println("Small"); price = 2.5; } else if (boxSize == 20) { System.out.println("Medium"); price = 3.75; } else if (boxSize == 30) { System.out.println("Large"); price = 5.0; } else { System.out.println ("Not a valid size."); price = -1; }
! (age >= 65 && income < 20000)
Since there are three simple statements there are 8 possible combinations of truth values in the truth table. However these statements are related so not all 8 combinations are possible. For example, if p is true (that is the year is divisible by 400) then q and r must also be true (a number divisible by 400 is also divisible by 100 and is divisible by 4). Similarly if q is true r must also be true since a number divisible by 100 is also divisible by 4. Complete the truth table below indicating whether or not a particular row in the table is possible. If it is give a date that satisfies the condition (for example if p, q, and r are all three true then one example would be 1600 because it is divisble by 400, by 100, and by 4).
Year divisible by 400 100 4 Possible? Example Year p q r T T T Yes 1600 T T F No (Not possible - if p is true r must be true) T F T ______ ____________ T F F ______ ____________ F T T ______ ____________ F T F ______ ____________ F F T ______ ____________ F F F ______ ____________