(Java) The first Print Statement loops twice after going around once. I am a new coder, and I have tried looking to see what is wrong but I have no clue what is wrong. Everything else works fine, I think the loop or the switch is causing the problem but again, I have no idea.
Scanner sc = new Scanner(System.in);
for (int i = 1; i>0; i++) {
System.out.print("Type in the name of the type of Equation you want to solve on the line below: (Addition, Subtraction, Multiplication, Division, Exponents) If you want to Stop using the calculator, type 'Close'");
System.out.println("");
String Input = sc.nextLine();
if (Input.equals("Close")) {
break;
}
switch (Input) {
case "Addition" :
System.out.print("Type in your first number: ");
Double Addition1 = sc.nextDouble();
System.out.print("Type in what you want to add your first number by: ");
Double Addition2 = sc.nextDouble();
Double Sum = Addition1 + Addition2;
System.out.println(Addition1 + " + " + Addition2 + " = " + Sum);
System.out.println("");
break;
case "Subtraction" :
System.out.print("Type in your first number: ");
Double Subtraction1 = sc.nextDouble();
System.out.print("Type in what you want to subtract your first number by: ");
Double Subtraction2 = sc.nextDouble();
Double Difference = Subtraction1 - Subtraction2;
System.out.println(Subtraction1 + " - " + Subtraction2 + " = " + Difference);
System.out.println("");
break;
case "Multiplication" :
System.out.print("Type in your first number: ");
Double Multiplication1 = sc.nextDouble();
System.out.print("Type in what you want to multiply your first number by: ");
Double Multiplication2 = sc.nextDouble();
Double Product = Multiplication1 * Multiplication2;
System.out.println(Multiplication1 + " * " + Multiplication2 + " = " + Product);
System.out.println("");
break;
case "Division" :
System.out.print("Type in your first number: ");
Double Division1 = sc.nextDouble();
System.out.print("Type in what you want to divide your first number by: ");
Double Division2 = sc.nextDouble();
Double Quotient = Division1 / Division2;
System.out.println(Division1 + " / " + Division2 + " = " + Quotient);
System.out.println("");
break;
}
}