Assignemnt #30
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: thirty first Program
/// File Name: ShallowGrandmother.java
/// Date Finished: 10/6/2015
import java.util.Scanner;
public class ShallowGrandmother
{
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 attractive are you, on a scale from 0.0 to 10.0? " );
attractiveness = keyboard.nextDouble();
allowed = ( age > 20 && age < 30 && ( income > 100000 || attractiveness >= 7.0 ) );
System.out.println( "You are allowed to date my grandchild: " + allowed );
System.out.println( "If you are elligble you are 20-30, get paid 100,000+ a year and are semi-attracitve. " );
}
}
Picture of the output