// Calculate sum, product, difference and quotient

import java.util.Scanner;

import javax.swing.JOptionPane;

public class upgraded

{

public static void main( String[] args )

{

JOptionPane.showMessageDialog( null, "Welcome To calculator" );

{

Scanner input = new Scanner( System.in );

int x;

int y;

int sum;

int difference;

int product;

int division;

int remainder;

int z;

System.out.print( "Enter your first number madafaka: " );

x = input.nextInt();

System.out.print( "Enter your SECOND number madafakaaa: " );

y = input.nextInt();

System.out.println( "For the procedure you want to do type and enter, \n1 for sum \n 2 for difference\n 3 for division \n4 for multiplacation \n5 for remainder " );

z = input.nextInt();

if ( z == 1)

sum = x + y;

System.out.printf( "Sum is %d\n", sum );

if ( z == 2 )

difference = x - y;

System.out.printf( "Difference is %d\n", difference );

if ( z == 3 )

product = x * y;

System.out.printf( "Product is %d\n", product );

if ( z == 4 )

division = x / y;

System.out.printf( "Quotient is %d\n", division );

if ( z == 5 )

remainder = x%y;

System.out.printf( "Remainder is %d\n", remainder );

}

}

}

when i compile this one ( i know its not well-written, lets say its just a simple one) it gives the error

upgraded.java:36: variable sum might not have been initialized

System.out.printf< "Sum is %d\n", sum >;

^

and same for the other 5 systemoutprintf lines, too.

The problem is always seems like with the last word, such as sum - difference etc.

Thats it. Any ideas why that happens?