Question: I need UML for my code please import java.util.Scanner; public class atm { static Scanner input = new Scanner(System.in); public static void main(String args[] )

I need UML for my code please

import java.util.Scanner;

public class atm { static Scanner input = new Scanner(System.in); public static void main(String args[] ) { int balance = 5000; //simulating the ATM while(true) { //show the available possible options showMenu(); int n = input.nextInt(); switch(n) { case 1: //withdraw from ATM balance = withdrawMoney(balance); break;

case 2: //balance check System.out.println("Available Balance: $"+balance); break; case 4: input.close(); System.exit(0); default: System.out.println("Invalid selection. Please try again!!"); } System.out.println(" "); } }

/** * Method to show the possible options in the menu */ private static void showMenu() { System.out.println("atm test"); System.out.println("Enter 1 to Withdraw Money, and 2 Check Balance"); System.out.print("Enter your choice: "); } /** Method to withdraw the amount */ private static int withdrawMoney(int balance) { System.out.print("Enter money to be withdrawn: $"); int withdraw = input.nextInt(); //check sufficient balance available if(balance >= withdraw) { balance -= withdraw; System.out.println("Please collect your money"); } else System.out.println("Insufficient Balance"); return balance; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!