waltermilner

Untitled

Nov 1st, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.97 KB | None | 0 0
  1. class Test2 {
  2.  
  3.     private static double ini_amt = 0;
  4.     private static long acc_no = 0;
  5.     private static String name = "";
  6.     private static String address = "";
  7.     private static long num = 0;
  8.     private static String name_ja = "";
  9.     private static String intr = "";
  10.     private static char tlc = ' ';
  11.     private static String[] a1 = new String[6];
  12.  
  13.     public static void main(String[] args) throws IOException
  14.     {
  15.         boolean finished = false;
  16.         System.out.println("+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+");
  17.         System.out.println("|W|e|l|c|o|m|e| |t|o| |N|e|x|u|s| |B|a|n|k|s|!|");
  18.         System.out.println("+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+");
  19.         System.out.println();
  20.         do {
  21.             // display menu:
  22.             System.out.println("Please enter your choice:");
  23.             BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  24.  
  25.             System.out.println("a. Open Account");
  26.             System.out.println("b. Deposit");
  27.             System.out.println("c. Withdraw");
  28.             System.out.println("d. Add Interest");
  29.             System.out.println("e. Print Account Summary");
  30.             System.out.println("f. Make fixed deposit");
  31.             System.out.println("g. Modify Account Information");
  32.             System.out.println("h. Delete Account Information");
  33.             System.out.println("i. Quit");
  34. // get input
  35.             String str1 = br.readLine();
  36.             str1 = str1.trim();
  37.  
  38.             // validate it
  39.             boolean valid = true;
  40.             if (str1.length() != 1) {
  41.                 valid = false;
  42.             }
  43.             char ca = str1.charAt(0);
  44.             char tlc1 = Character.toLowerCase(ca);
  45.             tlc = tlc1;
  46.             if (tlc == 'a' || tlc == 'b' || tlc == 'c' || tlc == 'd' || tlc == 'e' || tlc == 'f' || tlc == 'g' || tlc == 'h' || tlc == 'i') {
  47.                 valid = true;
  48.             }
  49.             if (!valid) {
  50.                 System.out.println("Please enter one of the above choices.");
  51.                 continue; // try again
  52.             }
  53. // process options
  54.             if (tlc == 'a') {
  55.                 inputData();
  56.             } else if (tlc == 'b') {
  57.                 deposit();
  58.             } else if (tlc == 'c') {
  59.                 withdraw();
  60.             } else if (tlc == 'd') {
  61.                 fixedDeposit();
  62.             } else if (tlc == 'e') {
  63.                 printSummary();
  64.             } else if (tlc == 'f') {
  65.                 fixedDeposit();
  66.             } else if (tlc == 'g') {
  67.                 modifyData();
  68.             } else if (tlc == 'h') {
  69.                 deleteData();
  70.             } else if (tlc == 'i') {
  71.                 quit();
  72.                 finished = true;
  73.             }
  74.         } while (!finished);
  75.  
  76.     }
  77.  
  78.     private static void inputData() throws IOException {
  79.        
  80.             System.out.println("Input");
  81.            
  82.  
  83.     }
  84.  
  85.     private static void deposit() throws IOException {
  86.        
  87.             System.out.println("deposit: ");
  88.            
  89.     }
  90.  
  91.     private static void withdraw() throws IOException {
  92.        
  93.             System.out.println("withdraw ");
  94.            
  95.     }
  96.  
  97.     private static void printSummary() throws IOException {
  98.  
  99.  
  100.                 System.out.println("Summary ");
  101.                                                                      
  102.            
  103.     }
  104.  
  105.     private static void fixedDeposit() throws IOException {
  106.        
  107.                         System.out.println("fixed deposit ");
  108.                        
  109.     }
  110.  
  111.     private static void modifyData() throws IOException {
  112.        
  113.                 System.out.println("Modify ");
  114.                
  115.     }
  116.  
  117.     private static void deleteData() throws IOException {
  118.        
  119.                 System.out.println("Delete ");
  120.                
  121.     }
  122.  
  123.     private static void quit() {
  124.         System.out.println("Thank you for using Nexus Banks! Have a good day!");
  125.        
  126.     }
  127. }
Advertisement
Add Comment
Please, Sign In to add comment