Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test2 {
- private static double ini_amt = 0;
- private static long acc_no = 0;
- private static String name = "";
- private static String address = "";
- private static long num = 0;
- private static String name_ja = "";
- private static String intr = "";
- private static char tlc = ' ';
- private static String[] a1 = new String[6];
- public static void main(String[] args) throws IOException
- {
- boolean finished = false;
- System.out.println("+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+");
- System.out.println("|W|e|l|c|o|m|e| |t|o| |N|e|x|u|s| |B|a|n|k|s|!|");
- System.out.println("+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+");
- System.out.println();
- do {
- // display menu:
- System.out.println("Please enter your choice:");
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- System.out.println("a. Open Account");
- System.out.println("b. Deposit");
- System.out.println("c. Withdraw");
- System.out.println("d. Add Interest");
- System.out.println("e. Print Account Summary");
- System.out.println("f. Make fixed deposit");
- System.out.println("g. Modify Account Information");
- System.out.println("h. Delete Account Information");
- System.out.println("i. Quit");
- // get input
- String str1 = br.readLine();
- str1 = str1.trim();
- // validate it
- boolean valid = true;
- if (str1.length() != 1) {
- valid = false;
- }
- char ca = str1.charAt(0);
- char tlc1 = Character.toLowerCase(ca);
- tlc = tlc1;
- if (tlc == 'a' || tlc == 'b' || tlc == 'c' || tlc == 'd' || tlc == 'e' || tlc == 'f' || tlc == 'g' || tlc == 'h' || tlc == 'i') {
- valid = true;
- }
- if (!valid) {
- System.out.println("Please enter one of the above choices.");
- continue; // try again
- }
- // process options
- if (tlc == 'a') {
- inputData();
- } else if (tlc == 'b') {
- deposit();
- } else if (tlc == 'c') {
- withdraw();
- } else if (tlc == 'd') {
- fixedDeposit();
- } else if (tlc == 'e') {
- printSummary();
- } else if (tlc == 'f') {
- fixedDeposit();
- } else if (tlc == 'g') {
- modifyData();
- } else if (tlc == 'h') {
- deleteData();
- } else if (tlc == 'i') {
- quit();
- finished = true;
- }
- } while (!finished);
- }
- private static void inputData() throws IOException {
- System.out.println("Input");
- }
- private static void deposit() throws IOException {
- System.out.println("deposit: ");
- }
- private static void withdraw() throws IOException {
- System.out.println("withdraw ");
- }
- private static void printSummary() throws IOException {
- System.out.println("Summary ");
- }
- private static void fixedDeposit() throws IOException {
- System.out.println("fixed deposit ");
- }
- private static void modifyData() throws IOException {
- System.out.println("Modify ");
- }
- private static void deleteData() throws IOException {
- System.out.println("Delete ");
- }
- private static void quit() {
- System.out.println("Thank you for using Nexus Banks! Have a good day!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment