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

Java Banking System Simulation

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)
12 views1 page

Java Banking System Simulation

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

package com.

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

You might also like