Assignemnt: Project #4 -> Calculator

Code
/// Name: Yordan Rashkov
/// Period: 7
/// Program Name: Calculator
/// File Name: calculator.java
/// Date Finished: 5/6/2016

import java.util.Scanner;

    public class calculator
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
        
            double x, y, z;
            String gry;
    
            do
            {
                System.out.print("> ");
                x  = keyboard.nextDouble();
                gry = keyboard.next();
                y  = keyboard.nextDouble();
    
                if ( gry.equals("+") )
                    z = x + y;
                else if ( gry.equals("-") )
                    z = x - y;
                else if ( gry.equals("*") )
                    z = x * y;
                else if ( gry.equals("/") )
                    z = x / y;
                else if ( gry.equals("^") ){
                    z = 1;
                    for (int i = 0; i < y; i++){
                        z = z * x;
                    }
                }
                else if ( gry.equals("%") )
                    z = x % y;
                else
                {
                    System.out.println("Undefined operator: '" + gry + "'.");
                    z = 0;
                }
    
                if ( x != 0 )
                    System.out.println(z);
    
            } while ( x != 0 );
            System.out.println("AdiĆ³s!");
        }
    }