Isaguirre_ATM.java - Isaguirre Daniel G WTHFS 1:30-6:00 import java.util.Scanner public class Isaguirre_ATM public static void main(String args int

Isaguirre_ATM.java - Isaguirre Daniel G WTHFS 1:30-6:00...

This preview shows page 1 - 2 out of 2 pages.

/** Isaguirre, Daniel G. WTHFS 1:30-6:00 */ import java.util.Scanner; public class Isaguirre_ATM { public static void main(String[] args) { int balance = 5000, withdraw, deposit, flag; Scanner s = new Scanner(System.in); while(true) { System.out.println("---------ATM---------"); System.out.println("1. Withdraw"); System.out.println("2. Deposit"); System.out.println("3. Check Balance"); System.out.println("4. EXIT"); System.out.print("Choose operation: "); int n = s.nextInt(); switch(n) { case 1: System.out.print("Enter amount to be withdrawn: "); withdraw = s.nextInt(); if(balance >= withdraw) { balance = balance - withdraw; System.out.println("Collect your money");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture