SHARE
TWEET

Untitled

a guest Feb 27th, 2020 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class BankApplication {
  4.     private long idNr;
  5.     private static Scanner scan = new Scanner(System.in);
  6.     private static Bank bank = new Bank();
  7.     private static int val;
  8.  
  9.     public static void main(String[] args) {
  10.  
  11.         menu();
  12.  
  13.         bank.addAccount("Annie Börjesson", 0012101325);
  14.         bank.addAccount("matilda Kvarnström", 941234);
  15.         bank.addAccount("Hej", 892347);
  16.         bank.addAccount("Ola", 1234567);
  17.         bank.addAccount("axel", 43785);
  18.         bank.addAccount("Mzrten", 340958);
  19.  
  20.  
  21.         while (true) {
  22.  
  23.             val = scan.nextInt();
  24.             System.out.println("val: " + val);
  25.             scan.nextLine();
  26.             runApplication();
  27.  
  28.         }
  29.  
  30.     }
  31.  
  32.     public static void runApplication() {
  33.  
  34.         switch (val) {
  35.         case 1:
  36.             break;
  37.         case 2:
  38.             break;
  39.         case 3:
  40.             break;
  41.         case 4:
  42.             break;
  43.         case 5:
  44.             break;
  45.         case 6:
  46.             System.out.println("Skriv ditt namn");
  47.             String namn = scan.nextLine();
  48.             System.out.println("Skriv ditt personnummer");
  49.             long id = scan.nextLong();
  50.             scan.nextLine();
  51.  
  52.             bank.addAccount(namn, id);
  53.             // System.out.println(.getAccountNbr());
  54.             break;
  55.         case 7:
  56.             break;
  57.         case 8:
  58.             System.out.println("Konton: " + bank.getAllAccounts());
  59.             break;
  60.         case 9:
  61.             break;
  62.         }
  63.     }
  64.  
  65.     public static void menu() {
  66.  
  67.         System.out.println("1. Hitta konto utifrån innehavare");
  68.         System.out.println("2. Sök kontoinnehavare utifrån (del av) namn");
  69.         System.out.println("3. Sätt in");
  70.         System.out.println("4. Ta ut");
  71.         System.out.println("5. Överföring");
  72.         System.out.println("6. Skapa konto");
  73.         System.out.println("7. Ta bort konto");
  74.         System.out.println("8. Skriv ut konton");
  75.         System.out.println("9. Avsluta");
  76.         System.out.println("Välj ett menyval");
  77.  
  78.     }
  79. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top