Advertisement
Guest User

asdasd

a guest
Jul 3rd, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. package day2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Regg {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner user = new Scanner(System.in);
  9.  
  10.         System.out.println("Please enter your name:");
  11.  
  12.         String name = user.nextLine();
  13.  
  14.         System.out.println("Please enter your age: ");
  15.  
  16.         byte age = user.nextByte();
  17.  
  18.         System.out.println("Please enter your email adress:");
  19.  
  20.         String email = user.nextLine();
  21.  
  22.         System.out.println("Please enter your password:");
  23.  
  24.         String password = user.nextLine();
  25.  
  26.         if (name.length() < 3 || name.contains("\\d+")) {
  27.             System.out.println("Unproper name");
  28.         } else
  29.             System.out
  30.                     .println("Enetered name pass all tests you can countinue");
  31.         if (age < 5 || age > 90) {
  32.             System.out.println("Unproper years");
  33.         } else
  34.             System.out
  35.                     .println("Enetered years pass all tests you can countinue");
  36.         if (password.length() < 5) {
  37.             System.out.println("Unproper password");
  38.         } else System.out.println("Enetered password pass all tests you can countinue");
  39.  
  40.     }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement