最近作成した電卓で問題が発生しました。
何が悪いのか、何をしなければならないのかよくわからないので、助けていただければ幸いです。
public class calcclass {
public static void main(String []args){
Scanner input = new Scanner(System.in);
int numberone;
System.out.print("Type in a number : ");
numberone = input.nextInt();
System.out.println("");
System.out.print("Type in another number : ");
int numbertwo = input.nextInt();
System.out.println("");
System.out.print("Do you wish to 1(+), 2(-), 3(*), 4(/) : ");
int Answer = input.nextInt();
System.out.println("");
int Sum;
if (( Answer == '1'))
{
System.out.println("PLUS");
Sum = numberone + numbertwo;
System.out.println("The answer is : " + Sum);
}
if (( Answer == '2'))
{
System.out.println("MINUS");
Sum = numberone - numbertwo;
System.out.println("The answer is : " + Sum);
}
if (( Answer == '3'))
{
System.out.println("GONGE");
Sum = numberone * numbertwo;
System.out.println("The answer is : " + Sum);
}
if (( Answer == '4' ))
{
System.out.println("DELE");
Sum = numberone / numbertwo;
System.out.println("The answer is : " + Sum);
}
}
}