I'm writing a really simple Java program and for some reason it just terminates when it gets to the part where I type what operation I want it to do.
package practice;
import java.util.Scanner;
public class Practice4 {
static Scanner Saish = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("Hello! I am Siricalc. I am your personal calculator app!");
System.out.println("");
System.out.println("Please tell me your first number.");
int firstnum = Saish.nextInt();
System.out.println("Thanks! Now please tell me your second number!");
int secondnum = Saish.nextInt();
System.out.println("Got it! I just need to to know what you need to do with your numbers:");
System.out.println(" Type Addition, Subtraction, Division, or Multiplication.");
String Operation = Saish.nextLine();
if(Operation.equals("Addition") || Operation.equals("addition")){
int sum = firstnum + secondnum;
System.out.println("Here is the sum of your first number and your second number" + sum);
}
else if(Operation.equals("Subtraction") || Operation.equals("subtraction")){
int difference = firstnum - secondnum;
int defference = secondnum - firstnum;
System.out.println("Here is the result of the first number minus the second number" + difference);
System.out.println("Here is the result of the second number minus the first number" + defference);
}
else if(Operation.equals("Division") || Operation.equals("division")){
System.out.println("Here is the result for your first number divided by your second number" + firstnum/secondnum);
System.out.println("Here is the result for your second number divided by your first number" + secondnum/firstnum);
}
else if(Operation.equals("Multiplication") || Operation.equals("multiplication")){
int product = firstnum * secondnum;
System.out.println("Here is the product of your first number and your second number" + product);
}
}
}
After it takes the second number, it asks for me to type one of those 4 operations; After that it just terminates. Why?