Opening Hours :7AM to 9PM
import java.util.Scanner; class ATM { int balance = 10000; Scanner scanner = new Scanner(System.in); public void checkBalance() { System.out.println("Your balance is: " + balance); } public void withdraw() { System.out.print("Enter the amount to withdraw: "); int amount = scanner.nextInt(); if (amount > balance) { System.out.println("Insufficient balance! Please try again."); } else { balance -= amount; System.out.println("Please collect your cash."); System.out.println("Your updated balance is: " + balance); } } public void deposit() { System.out.print("Enter the amount to deposit: "); int amount = scanner.nextInt(); balance += amount; System.out.println("Your updated balance is: " + balance); } } class Main { private static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { ATM a=new ATM(); while (true) { System.out.println("Welcome to the ATM!"); System.out.println("1. Check Balance"); System.out.println("2. Withdraw"); System.out.println("3. Deposit"); System.out.println("4. Exit"); System.out.print("Enter your choice: "); int choice = scanner.nextInt(); switch (choice) { case 1: a.checkBalance(); break; case 2: a.withdraw(); break; case 3: a.deposit(); break; case 4: System.out.println("Thank you for using our ATM! Have a nice day!"); System.exit(0); break; default: System.out.println("Invalid choice! Please try again."); break; } } } }In this example, the main method presents the user with a menu of choices and uses a switch statement to call the appropriate method based on the user's selection. The checkBalance, withdraw, and deposit methods perform the corresponding operations on the balance variable, which is a static variable that represents the user's account balance.