Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- import java.util.Scanner;
- public class Main
- {
- public static void startMessage()
- {
- String message = "Welcome to System1, a developmental program that currently has no purpose! Please login using password as the password.";
- System.out.println(message);
- startUp();
- }
- public static void startUp()
- {
- String pw = "password";
- Scanner scan = new Scanner(System.in);
- boolean pwTrue = false;
- String userPwIn = scan.nextLine();
- if(userPwIn == pw)
- {
- pwTrue = true;
- }
- if(pwTrue)
- {
- login();
- }
- }
- public static void login()
- {
- startMessage();
- String username;
- Scanner scan = new Scanner(System.in);
- System.out.println("Please enter your new username!");
- username = scan.nextLine();
- System.out.println("Hello " + username + "!");
- }
- public static void main(String args[]){
- startMessage();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement