Advertisement
Guest User

code

a guest
Aug 21st, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. package main;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main
  6. {
  7. public static void startMessage()
  8. {
  9. String message = "Welcome to System1, a developmental program that currently has no purpose! Please login using password as the password.";
  10. System.out.println(message);
  11. startUp();
  12. }
  13.  
  14. public static void startUp()
  15. {
  16.  
  17. String pw = "password";
  18. Scanner scan = new Scanner(System.in);
  19. boolean pwTrue = false;
  20.  
  21. String userPwIn = scan.nextLine();
  22. if(userPwIn == pw)
  23. {
  24. pwTrue = true;
  25. }
  26.  
  27. if(pwTrue)
  28. {
  29. login();
  30. }
  31.  
  32. }
  33.  
  34. public static void login()
  35. {
  36.  
  37. startMessage();
  38.  
  39. String username;
  40. Scanner scan = new Scanner(System.in);
  41.  
  42. System.out.println("Please enter your new username!");
  43. username = scan.nextLine();
  44.  
  45. System.out.println("Hello " + username + "!");
  46.  
  47.  
  48.  
  49. }
  50.  
  51. public static void main(String args[]){
  52.  
  53. startMessage();
  54.  
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement