Assignemnt #31 and Compound Boolean
Code
/// Name: Kyle Ivy
/// Period: 5
/// Program Name: CompoundBoolean
/// File Name: CompoundBoolean.java
/// Date Finished: 10/20/2015
import java.util.Scanner;
public class CompoundBoolean {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
int age;
double income, rate;
boolean answer;
System.out.print( "Enter your age: " );
age = keyboard.nextInt();
System.out.print( "Enter your yearly income: " );
income = keyboard.nextDouble();
System.out.print( "How attractive are you from 0.0 to 10.0??? " );
rate = keyboard.nextDouble();
answer = ( age > 25 && age < 40 && (income > 50000 || rate >= 8 ) );
System.out.println( "You are allowed to date my grandchild: " + answer );
}
}
prog31.PNG