Do-While Help, probably really simple

Can anyone help me figure out why this program is only accepting choice number 4? Thank you for any and all assistance!

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        final int SUM = 1;
        final int FACTORIAL = 2;
        final int FACTORS = 3;
        final int QUIT = 4;

        int choice = 0;
        int num = 0;

        do {

            System.out.print("Choice: ");
            choice = scanner.nextInt();
            System.out.println(choice);

        } while (choice != 4);

        switch (choice) {

            case SUM:

            System.out.print("\nPlease enter a number: ");

            num = scanner.nextInt();
            int sum = 0;
            int count = 0;

            while (count < num) {
                
                count ++;
                sum = sum + count;
                
            }

            System.out.println("Sum of numbers from 1 - " + num + " is " + sum + ".");
            break;

            case FACTORIAL:

            System.out.print("\nPlease enter a number: ");
            
            num = scanner.nextInt();    
            long fact = 1;

            for (int i = num; i > 1; i --) {
                
                fact = fact * i;

            }

            System.out.println("Factorial of " + num + "is " + fact + ".");
            break;

            case FACTORS:

            System.out.print("\nPlease enter a number: ");

            num = scanner.nextInt();

            for (int counter = 1; counter <= num; counter ++) {

                if (num % counter == 0) { 

                    System.out.println(counter + "  ");

                }

            }

            break;

            case QUIT:

            System.out.println("Your choice was " + QUIT + ", Quitting the program, have a good day!");

            break;

            default:

            System.out.println("Incorrect choice, " + choice + " Please choose again.");

            break;


        }
        
        scanner.close();

    }
}

Because you told it to. You are leaving the do-while loop only if choice is 4. Maybe you wanted to have the switch inside the do-while loop or call it as a method?

This is what I ended up changing, thanks for pointing that out for me.

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        final int SUM = 1;
        final int FACTORIAL = 2;
        final int FACTORS = 3;
        final int QUIT = 4;
        int choice = 0;
        int num = 0;
        
        do {

            System.out.print("\nChoice: ");
            choice = scanner.nextInt();
            System.out.println(choice);

            switch (choice) {

                case SUM:

                    System.out.print("\nPlease enter a number: ");
                    num = scanner.nextInt();
                    int sum = 0;
                    int count = 0;

                    while (count < num) {

                        count++;
                        sum = sum + count;

                    }
                    
                    System.out.println("Sum of numbers from 1 - " + num + " is " + sum + ".");
                    
                    break;
                
                    case FACTORIAL:

                    System.out.print("\nPlease enter a number: ");
                    num = scanner.nextInt();
                    long fact = 1;

                    for (int i = num; i > 1; i--) {
                        fact = fact * i;
                    }

                    System.out.println("Factorial of " + num + " is " + fact + ".");
                    
                    break;
                
                    case FACTORS:

                    System.out.print("\nPlease enter a number: ");
                    num = scanner.nextInt();

                    for (int counter = 1; counter <= num; counter++) {
                        if (num % counter == 0) {
                            System.out.print(counter + "  ");
                        }
                    }

                    break;

                case QUIT:

                    System.out.println("Your choice was " + QUIT + ", Quitting the program, have a good day!");
                    break;

                default:
                    System.out.println("Incorrect choice, " + choice + " Please choose again.");
                    break;

            }
        } while (choice != 4);

        scanner.close();
    }
}