Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. package Bank;
  2.  
  3. import java.util.Arrays;
  4. import java.util.Scanner;
  5. import java.util.Random;
  6.  
  7. /**
  8. *
  9. * @author Kornel
  10. */
  11. class Account{
  12.  
  13. }
  14.  
  15. class Bank{
  16. public String imie;
  17. public String nazwisko;
  18. private long stanKonta;
  19. private String numerKonta;
  20. private String numerKarty;
  21.  
  22. Scanner SC = new Scanner(System.in);
  23. static String[] tab = new String [1];
  24.  
  25.  
  26. //otwieranie konta
  27. void otwieranieKonta(){
  28. System.out.println("Otwieranie konta ");
  29.  
  30. //pobieranie name surname
  31.  
  32. for(int i=0;i<1;i++){
  33. System.out.println("Podaj imię i nazwisko: ");
  34. tab[i] = SC.nextLine();
  35. }
  36.  
  37. for(int i=0;i<1;i++){
  38. System.out.println("Witaj " + tab[i]);
  39. }
  40. }
  41.  
  42. //wyświetlanie danych
  43. void pokazDane(){
  44. System.out.println(tab);
  45. }
  46.  
  47.  
  48. public static void main(String[] args){
  49. Scanner skaner = new Scanner(System.in);
  50. int pozycjeMenu;
  51.  
  52.  
  53.  
  54. do{
  55. System.out.println("Main Menu 1. Tworzenie konta.\n 2. Pokaz dane\n 3.Exit");
  56.  
  57. System.out.println("Choose option: ");
  58. pozycjeMenu=skaner.nextInt();
  59.  
  60.  
  61. switch(pozycjeMenu){
  62. case 1:
  63. System.out.println("Ilu użytkowników chcesz dodać?: ");
  64. int ilu = skaner.nextInt();
  65. Bank X[]=new Bank[ilu];
  66.  
  67. for(int i=0;i<X.length;i++)
  68. {
  69. X[i]=new Bank();
  70. X[i].otwieranieKonta();
  71. }
  72. break;
  73.  
  74. case 2:
  75. System.out.println("Wyświetlam dane: ");
  76. int n=skaner.nextInt();
  77. Bank C[]=new Bank[n];
  78.  
  79. for(int i=0;i<C.length;i++)
  80. {
  81. C[i].pokazDane();
  82. }
  83. break;
  84.  
  85. case 3:
  86. System.out.println("Do zobaczenia! :)");
  87. break;
  88. }
  89. }
  90. while(pozycjeMenu!=3);
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement