小编The*_*ter的帖子

Java - 程序没有突破循环?

while (choice != 7) { 

    System.out.println("---  Mathematical Calculator  ---");

    System.out.println("");

    System.out.println("Pick an operation from the list - Use nos. 1 to 7");
    System.out.println("1) Multiplication");
    System.out.println("2) Division");
    System.out.println("3) Addition");
    System.out.println("4) Subtraction");
    System.out.println("5) Find the area of a regular object");
    System.out.println("6) Find the volume of a regular object");
    System.out.println("7) Exit");

    choice = userInput.nextInt(); 

    switch (choice) {

    case 1: {
        System.out.println("");
        System.out.println("You have chosen multiplication");
        System.out.println("Enter a number");
        double num1 = userInput.nextDouble();
        System.out.println("Enter another number");
        double num2 = userInput.nextDouble();

        double num3 = num1 …
Run Code Online (Sandbox Code Playgroud)

java while-loop

4
推荐指数
1
解决办法
56
查看次数

标签 统计

java ×1

while-loop ×1