Prog 49: Gender Game
///Name: Ilana Levy
///Period: 5
///Project Name: Gender Game
///File Name: genderGame.java
///Date Finished: 9/17/2015
import java.util.Scanner;
public class genderGame
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in );
String gender, fName, lName, married;
int age;
System.out.print( "What is your gender (M or F): " );
gender = keyboard.next();
System.out.print( "First Name: " );
fName = keyboard.next();
System.out.print( "Last Name: " );
lName= keyboard.next();
System.out.print( "Age: ");
age = keyboard.nextInt();
if ( gender.equals("F") && age > 19 )
{
System.out.print( "Are you married, " + fName + " (y or n)? " );
married = keyboard.next();
if (married.equals("y") )
{
System.out.print( "Then I shall call you Mrs. " + lName );
}
else
{
System.out.print( "Then I shall call you Ms. " + lName );
}
}
else if ( gender.equals("M") && age > 19)
{
System.out.print( "Then I shall call you Mr. " + lName );
}
else if ( age <= 19 )
{
System.out.println( "Then I shall call you " + fName + " " + lName );
}
}
}