我最近创建的计算器出现了一些问题。
我不太清楚哪里出了问题,我必须做什么,所以我希望能得到一些帮助。
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);
}
}
}