Advertisement
Guest User

Untitled

a guest
Mar 12th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. import java.io.File;
  2. import java.io.FileNotFoundException;
  3. import java.io.PrintWriter;
  4. import java.util.Objects;
  5. import java.util.Scanner;
  6.  
  7. /**
  8. * Created by Kamil on 18.02.2017.
  9. */
  10.  
  11. public class JestProgress {
  12. public static int menu() {
  13. System.out.println(" ****************************************");
  14. System.out.println(" * JEST PROGRESS *");
  15. System.out.println(" ****************************************");
  16. System.out.println("1. Nowy Uzytkownik");
  17. System.out.println("2. Wyswietl dane");
  18. System.out.println("3. Zaloguj sie");
  19. System.out.println("0. Wyjscie");
  20.  
  21. Scanner in = new Scanner(System.in);
  22. int w = in.nextInt();
  23. return w;
  24. }
  25.  
  26. public static void main(String[] args) throws FileNotFoundException {
  27. int choice = menu();
  28. while (choice != 0) {
  29. Scanner in = new Scanner(System.in);
  30. User newuser = new User();
  31. String login1;
  32. int password1;
  33. switch (choice) {
  34. case 1:
  35. newuser.userdata();
  36. break;
  37. case 2:
  38. ControlPanel.show();
  39. break;
  40. case 3:
  41. System.out.print("Podaj login:");
  42. login1 = in.next();
  43. System.out.print("Podaj haslo:");
  44. password1 = in.nextInt();
  45. if (newuser.login == login1 && newuser.password == password1) {
  46. System.out.println("Zalogowales sie poprawnie.");
  47. }
  48. else {
  49. System.out.println("Niepoprawny login lub haslo, sprobuj ponownie.");
  50. }
  51. }
  52. choice = menu();
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement