package examples;

import chess.Chess;

public class MathProblem2 {
    
    public static void main(String[] args) {
        /* here you go */
        
        int i;
        i= Chess.getRandom(10);
        
        int j;
        j= Chess.getRandom(10);
        
        int k;
        k= Chess.getRandom(10);
       
        String name= Chess.readString( "What is your name?" );
        
        double startClock= Chess.getCurrentTimeSeconds();
        
        int answer= Chess.readInt( "What is "+i+"+"+j+"*"+k+"?" );
        
        double time= Chess.getCurrentTimeSeconds() - startClock;
        
        int correctAnswer= i+j*k;
        
        if ( answer != correctAnswer ) {
            Chess.report( "Wrong answer.  The right answer is "+correctAnswer );
        } else {
            Chess.report( "Good job, "+name+"!  You got the right answer in "+time+" seconds!" );
        } // endif
        
        
        /* two braces below */
    } // main
    
} // class 
