for round 2, change the “Do you want to [C]all or [Q]uit?:” to “Do you want to follow? [Y/N]: Y” with Y being yes and N being no.=, having the same logic as call and quit. Also, If the player’s most recent dealt card is bigger than the dealer, player is allowed to place bet after calling with "Player call, state bet: ". Also at the end of the game, “Next Game? (Y/N) >” if Y is selected, the game resets and 100 chips are given again. If N is selected, end with a “Game End”.

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class HighSum {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println(“HighSum GAME”);
        System.out.println(“================================================================================”);

        // Login system
        String username = “”;
        while (true) {
            System.out.print(“Enter your username: “);
            username = input.nextLine();

            System.out.print(“Enter your password: “);
            String password = input.nextLine();

            if (password.equals(“password”)) {
                System.out.println();
                System.out.println(“HighSum GAME”);
                System.out.println(”================================================================================”);

                System.out.println(username + “, You have 100 chips”);
                break;
            } else {
                System.out.println(“Incorrect username or password. Please try again.”);
            }
        }

        // Set initial chips to 100
        int chips = 100;

        boolean keepPlaying = true;
        while (keepPlaying) {
            System.out.println(”--------------------------------------------------------------------------------”);
            System.out.println(“Game starts - Dealer shuffles deck.”);
            System.out.println(“--------------------------------------------------------------------------------”);

            chips = playRound(username, chips, input);

            System.out.println(“--------------------------------------------------------------------------------”);
            System.out.print(“Next Game? (Y/N) > “);
            String nextGame = input.next();
            keepPlaying = nextGame.equalsIgnoreCase(“Y”);
        }

        input.close();
    }

    static int playRound(String username, int chips, Scanner input) {
        int roundNumber = 1;
        int currentBet = 0;
        boolean quit = false;

        // Create and shuffle deck
        ArrayList<Card> deck = new ArrayList<Card>();
        String[] suits = {“Hearts”, “Diamonds”, “Clubs”, “Spades”};
        String[] ranks = {“Ace”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “Jack”, “Queen”, “King”};
        for (String suit : suits) {
            for (String rank : ranks) {
                deck.add(new Card(suit, rank));
            }
        }
        Collections.shuffle(deck);

        // Deal cards to players
        ArrayList<Card> playerHand = new ArrayList<Card>();
        ArrayList<Card> dealerHand = new ArrayList<Card>();

        while (roundNumber <= 4 && !quit) {
            System.out.println(“Dealer dealing cards - ROUND " + roundNumber);
            System.out.println(”--------------------------------------------------------------------------------”);

            // Add cards
            playerHand.add(deck.remove(0));
            dealerHand.add(deck.remove(0));

            // Print players’ hands
            System.out.println(“Dealer”);
            if (roundNumber == 1) {
                System.out.print(”<HIDDEN CARD> “);
            } else {
                System.out.print(”<" + dealerHand.get(0) + “> “);
            }
            for (int i = 1; i < dealerHand.size(); i++) {
                System.out.print(”<” + dealerHand.get(i) + “> “);
            }
            System.out.println();

            System.out.println(username);
            for (Card card : playerHand) {
                System.out.print(”<” + card + "> ");
            }
            System.out.println();
            System.out.println("Value: " + playerHand.stream().mapToInt(Card::getValue).sum());

            // Bet
            boolean playerHasHigherCard = playerHand.get(playerHand.size() - 1).getValue() > dealerHand.get(dealerHand.size() - 1).getValue();
            if ((roundNumber == 1 && playerHasHigherCard) || roundNumber > 1) {
                System.out.print("Do you want to [C]all or [Q]uit?: ");
                String callOrQuit = input.next();
                if (callOrQuit.equalsIgnoreCase(“C”)) {
                    if (roundNumber == 1) {
                        System.out.print(“Player call, state bet: “);
                        currentBet = input.nextInt();
                    }
                } else if (callOrQuit.equalsIgnoreCase(“Q”)) {
                    quit = true;
                    chips -= currentBet;
                    System.out.println(username + “, You are left with " + chips + " chips”);
                    System.out.println(“Bet on table : " + (currentBet * 2));
                    System.out.println(“Dealer Wins”);
                    return chips;
                }
            } else if (roundNumber == 1) {
                System.out.println(“Dealer call, state bet: “);
                currentBet = (int) (Math.random() * (chips / 2) + 1);
                System.out.println(currentBet);
            }

            chips -= currentBet;
            System.out.println(username + “, You are left with " + chips + " chips”);
            System.out.println(“Bet on table : " + (currentBet * 2 * roundNumber));
            System.out.println(”--------------------------------------------------------------------------------”);
            roundNumber++;
        }

        if (!quit) {
            System.out.println(“Game End - Dealer reveal hidden cards”);
            System.out.println(”--------------------------------------------------------------------------------”);

            // Reveal dealer’s hand
            System.out.println(“Dealer”);
            for (Card card : dealerHand) {
                System.out.print(”<” + card + “> “);
            }
            System.out.println();
            System.out.println(“Value : " + dealerHand.stream().mapToInt(Card::getValue).sum());

            // Compare player and dealer values
            int playerValue = playerHand.stream().mapToInt(Card::getValue).sum();
            int dealerValue = dealerHand.stream().mapToInt(Card::getValue).sum();

            if (playerValue > dealerValue) {
                System.out.println(username + " Wins”);
                chips += (currentBet * 2 * (roundNumber - 1));
            } else {
                System.out.println(“Dealer Wins”);
            }

            System.out.println(username + “, You have " + chips + " chips”);
            System.out.println(“Dealer shuffles used cards and place behind the deck.”);
            System.out.println(”--------------------------------------------------------------------------------”);
        }

        return chips;
    }
}

class Card {
    private String suit;
    private String rank;

    public Card(String suit, String rank) {
        this.suit = suit;
        this.rank = rank;
    }

    public String getSuit() {
        return suit;
    }

    public String getRank() {
        return rank;
    }

    public int getValue() {
        if (rank.equals(“Ace”)) {
            return 14;
        } else if (rank.equals(“King”)) {
            return 13;
        } else if (rank.equals(“Queen”)) {
            return 12;
        } else if (rank.equals(“Jack”)) {
            return 11;
        } else {
            return Integer.parseInt(rank);
        }
    }

class Card {
    private String suit;
    private String rank;

    public Card(String suit, String rank) {
        this.suit = suit;
        this.rank = rank;
    }

    public String getSuit() {
        return suit;
    }

    public String getRank() {
        return rank;
    }

    public int getValue() {
        if (rank.equals("Ace")) {
            return 14;
        } else if (rank.equals("King")) {
            return 13;
        } else if (rank.equals("Queen")) {
            return 12;
        } else if (rank.equals("Jack")) {
            return 11;
        } else {
            return Integer.parseInt(rank);
        }
    }

    public String toString() {
        return rank + " of " + suit;
    }
}