import java.awt.*;
import javax.swing.*;

/**
/**
 * Determines if the answer is correct or incorrect, and displays the appropriate drawString 
 * 
 * @author Chase Conner
 * @version JDK 8
 * @course 1130-01
 * @date 11-30-15
 */
public class AnswerAnalysis{
     protected boolean correct = false; 

    /**
     * Constructor for objects of class AnswerAnalysis
     */
    public AnswerAnalysis()
    {
        
    }
    
     public boolean analyzeAnswer(String inputBox)
    {
           switch (inputBox){
                case "class": case "x and y coordinates": case "an inline comment": 
           
                correct = true;
                break;
                
                
                case "creates a new color": case "Boolean": case "Sets the level of access to classes, variables, and methods by other classes.":
                
                correct = true;
                break;
                
                
                case "for": case"8": case "Instance variables are declared outside of methods.":
                
                correct = true;
                break; 
                
    
                case "Yes, they do": case "No, they can't": case "employeeInfo(name, title, salary);":
               
                correct = true;
                break;
               
                
                case "null": case "break;": case "A method that sets the value of a field.":
               
                correct = true;
                break;
        
                
                default: 
                correct = false; 
                break;
          
            }
            
            return correct; 
    }
    
    public void display(Graphics g)
    {
        g.setColor(Color.blue); //changes the color to blue
        g.setFont(new Font("Arial", Font.PLAIN, 25)); //changes the font to Arial, size to 20, and style to plain
        
        //draws the notifications 
        if (correct == true){
            g.drawString("That is correct!", 100, 200);
        }
        else if (correct == false){
            g.drawString("Sorry, that is incorrect.", 100, 200); 
        }    
    }
}

    




  

