Assignment 31, Compound Boolean
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Compound Boolean
///File Name: ShallowGrandma.java
///Date Finshed: 10/19/15
import java.util.Scanner;
public class ShallowGrandma
{
public static void main( String[] args)
{
Scanner siri = new Scanner(System.in);
int age;
double income, attractiveness;
boolean allowed;
System.out.print(" Enter your age");
age= siri.nextInt();
System.out.print("Enter your income");
income= siri.nextDouble();
System.out.print("Enter your attractiveness on a scale from 1.0 - 10.0");
attractiveness = siri.nextDouble();
allowed = ( age > 25 && age < 40 && (income > 50000 || attractiveness >= 7.5));
System.out.print( "You are allowed to date my grandchild " +allowed );
}
}
Picture of the output