import java.util.Scanner; class TicketPriceWithDiscount { public static void main(String args[]) { Scanner myScanner = new Scanner(System.in); int age; double price = 0.00; char reply; System.out.print("How old are you? "); age = myScanner.nextInt(); System.out.print("Do you have a coupon? (Y/N)"); reply = myScanner.findInLine(".").charAt(0); if(age >= 12 && age < 65){ price = 9.25; } if(age < 12 || age >= 65){ price = 5.25; } if(reply == 'Y' || reply =='y'){ price -= 2.00; } if(reply !='Y' && reply !='y' && reply !='N' && reply != 'n' ){ System.out.println("Huh"); } } }
for the above code i am wondering if i were to change the 1st IF conditionintoif(age >= 12 && age < 65)would there be a difference?? right now i am having problems differentiating && and ||. just started out programming hereif(age >= 12 || age < 65)