Assignment #31 Compound Boolean
Code
///Name: Ian Grant
///Period:5
///Project Name: Compound Boolean
///File Name:ShallowGrandma.java
///10/16/15
import java.util.Scanner;
public class ShallowGrandma
{
public static void main(String[] args)
{
Scanner keyboard=new Scanner(System.in);
int age;
double income,attractiveness;
boolean allowed;
System.out.print("Enter your age: ");
age=keyboard.nextInt();
System.out.print("Enter your yearly income: ");
income=keyboard.nextDouble();
System.out.print("How attarctive are you, on a scalle frome 0.0 to 10.0? ");
attractiveness=keyboard.nextDouble();
allowed=(age > 25&&age< 40 && (income > 50000 || attractiveness >=8.5));
System.out.println("You are allowed to date my grandchild: "+allowed);
}
}
Output