Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.34 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class menu {
  3.  
  4.    
  5.     public static void main(String[] args){
  6.            
  7.         Scanner in = new Scanner (System.in);
  8.        
  9.         int a = 1;
  10.         while (a==1){
  11.             System.out.println("Test Program to create a new User:");
  12.             System.out.println("[1]Show list of Registered Usernames.");
  13.             System.out.println("[2]Show list of Registered Emails.\n\n");
  14.             System.out.println("[3]Test new username.");
  15.             System.out.println("[4]Test new email.");
  16.             System.out.println("[5]Test password validation.");
  17.             System.out.println("[6]Test date of birth validation.");
  18.             int checker;
  19.             String input = in.next();
  20.             in.close();
  21.            
  22.             if (input.equals("1")){
  23.                 System.out.println("Registered Usernames are: ");
  24.                 System.out.println(.get);
  25.             }
  26.             if (input.equals("2")){
  27.                 System.out.println("Registered Emials are: ");
  28.                 System.out.println(.get);
  29.             }
  30.            
  31.             if (input.equals("3")){
  32.                 checker = 1;
  33.                 while(checker == 1){
  34.                     String username = in.next();
  35.                     in.close();
  36.                     if(chekcusername)
  37.                         checker = 2;
  38.                 }
  39.             }
  40.             if (input.equals("4")){
  41.                     checker = 1;
  42.                     while(checker == 1){
  43.                         String email = in.next();
  44.                         in.close();
  45.                         if(listOfEmails email){
  46.                             checker = 2;
  47.                         }
  48.                     }
  49.                 }
  50.            
  51.             if (input.equals("5")){
  52.                 String password = "pwd1";
  53.                 String cPassword = "pwd2";
  54.                 while(password.compareTo(cPassword) == 0)
  55.                 {
  56.                     password = in.next();
  57.                     in.close();
  58.                     cPassword = in.next();
  59.                     in.close();
  60.             }
  61.            }  
  62.            if (input.equals("6")){
  63.                String bDay = "sdasas";
  64.                checker = 0;
  65.                while(checker == 1){
  66.                    bDay = in.next();
  67.                    in.close();
  68.                    if(today - bDay)
  69.                    {
  70.                        checker = 2;
  71.                    }
  72.                }       
  73.            }
  74.         }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement