Assignment 49 and Gender

Code

///Matthew Hughs
///Period 5
///Gender
///Gender.java
///12/2/2015

import java.util.Scanner;

class Gender
{
    public static void main (String [] args)
    {
        Scanner keyboard = new Scanner(System.in);
        
        int age; 
        String first, last, gender, marrage;
        
        System.out.println("What is your gender (M or F): ");
        gender = keyboard.next();
        System.out.println("First name: ");
        first = keyboard.next();
        System.out.println("Last name: ");
        last = keyboard.next();
        System.out.println("Age: ");
        age = keyboard.nextInt();
        System.out.println();
        
        if (age < 20)
        {
            
            System.out.println("Then I shall call you " + first + " " + last + ".");
        }
        else if (age >= 20)
        {
            if (gender.equals("M"))
            {
                System.out.println("Then I shall call you Mr. " + last + ".");
            }
            else if (gender.equals("F"))
            {
                System.out.println("Are you married, " + first + " (y or n)");
                marrage = keyboard.next();
                
                if (marrage.equals("y"))
                {
                    System.out.println("Then I shall call you Mrs. " + last + ".");
                }
                else if (marrage.equals("n"))
                {
                    System.out.println("Then I shall call you Ms. " + last + ".");
                }
                else
                {
                    System.out.println("done");
                } 
            }
            else
            {
                System.out.println("done");
            }    
        }
        else 
        {
            System.out.println("done");
        }    
    
    
    
    }
    
}
    

Picture of the output

Gender