0% found this document useful (0 votes)
49 views1 page

In Out Out Out Out Out

The document describes a simple banking program that allows a user to withdraw, deposit, check balance, and exit the program using a menu. The program uses a switch statement to perform the selected action and updates the running balance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views1 page

In Out Out Out Out Out

The document describes a simple banking program that allows a user to withdraw, deposit, check balance, and exit the program using a menu. The program uses a switch statement to perform the selected action and updates the running balance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

package com.

company;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
int balance = 5000, withdraw, deposit;
Scanner s = new Scanner(System.in);
while (true) {
System.out.println("::GOVERMENT POLYTEACHNIC BANKIG SERVICES::");
System.out.println("1. Withdraw");
System.out.println("2. Deposite");
System.out.println("3. Balance enquiry");
System.out.println("4. Exit");
int n = s.nextInt();
switch (n) {
case 1:
System.out.println("Enter the amount to withdraw:");
withdraw = s.nextInt();
if (balance >= withdraw) {
balance = balance - withdraw;
System.out.println("Thank for using our survices.Please collect your money.");
} else {
System.out.println("Insufficient Balance");
}
System.out.println("");
break;
case 2:
System.out.println("Enter the amount to deposited:");
deposit = s.nextInt();
balance = balance + deposit;
System.out.println("Thank for using our survices.Your money has been deposited");
System.out.println("");
break;
case 3:
System.out.println("Balance: " + balance);
System.out.println("");
break;
case 4:
System.exit(0);
}
}
}
}

You might also like