// CSE 142, Autumn 2009, Marty Stepp // This program prompts for information about a gentleman and uses it // to decide whether or not to go on a date with him. // The purpose of the program is to demonstrate the && and || operators. import java.util.*; public class ShouldIDateHim { public static void main(String[] args) { Scanner console = new Scanner(System.in); // prompt for important information about the man System.out.print("How old is he? "); int age = console.nextInt(); System.out.print("How tall is he (inches)? "); int height = console.nextInt(); System.out.print("How many exes does he have? "); int exes = console.nextInt(); System.out.print("How much money does he make? "); double salary = console.nextDouble(); // decide whether or not to date him if ((height >= 78 && exes < 10 && age >= 12 && age < 29) || salary >= 100000.0) { System.out.println("Okay, let's go out on a date!"); } else { System.out.println("It's not you, it's me..."); } } }