Guest User

Untitled

a guest
Dec 27th, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class users {
  4. public String user_name;
  5. public int user_id = 1;
  6. private String password;
  7. public static int count = 1;
  8. public static String input;
  9.  
  10. public users(String Ruser, String Rpassword) {
  11.  
  12. this.user_id = count++;
  13. this.user_name = Ruser;
  14. this.password = Rpassword;
  15. count++;
  16.  
  17. System.out.printf("User %s has been crated n", Ruser);
  18. System.out.printf("Enter 'login' to log in or 'register' to open another account");
  19.  
  20. }
  21.  
  22. public static void login(String Luser, String Lpassword) {
  23. for (int i = 1; i <= count; i++) {
  24. System.out.printf("Enter 'login' to log in or 'register' to open another account");
  25. // user_id.users
  26. // if(this.user_name)
  27. }
  28. }
  29.  
  30. public static void main(String[] args) {
  31. Scanner scanner = new Scanner(System.in);
  32. System.out.println("login");
  33. System.out.println("register");
  34. input = scanner.nextLine();
  35.  
  36.  
  37. while (input.equals("login")) {
  38.  
  39. System.out.println("username");
  40. String Luser = scanner.nextLine();
  41. System.out.println("Password");
  42. String Lpassword = scanner.nextLine();
  43. int a = count;
  44. login(Luser, Lpassword);
  45. System.out.println("");
  46. input = scanner.nextLine();
  47. }
  48. while (input.equals("register")) {
  49.  
  50. System.out.println("username");
  51. String Ruser = scanner.nextLine();
  52. System.out.println("Password");
  53. String Rpassword = scanner.nextLine();
  54. users count = new users(Ruser, Rpassword);
  55. System.out.println("");
  56. input = scanner.nextLine();
  57. }
  58. while ((!input.equals("register")) || (!input.equals("login"))) {
  59. System.out.println("invild option, chose login or regiser!");
  60. input = scanner.nextLine();
  61.  
  62.  
  63. }
Add Comment
Please, Sign In to add comment