All pastes #574395 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-18 15:28 UTC
rendered paste body
import java.util.Scanner;

public class Test1 {
	public static void main(String[] args) {
  	int first ;
  	int second;
  	int result = 9999999;
  	

		Scanner keyboard;
		keyboard = new Scanner(System.in);
		System.out.println("Enter operation (+,-,/,*):");
		String opsign = keyboard.nextLine();
		System.out.println("First number: ");
		first = keyboard.nextInt();
		System.out.println("Second number: ");
		second = keyboard.nextInt();
  	if (opsign == "+"){
  	
  		result =first+second;
  		opsign = "+";
    }
    else if (opsign == "-"){
    	result =first-second;
    	opsign ="-"	;
    }
    else if (opsign == "*"){
    	result =first*second;	
    	opsign = "*";
    }
    else if (opsign == "/"){
    	result =first/second;	
    	opsign = "/";
    }
    System.out.println(first+opsign+second+"="+result+"     "+opsign);
	}
}