Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package day2;
- import java.util.Scanner;
- public class Regg {
- public static void main(String[] args) {
- Scanner user = new Scanner(System.in);
- System.out.println("Please enter your name:");
- String name = user.nextLine();
- System.out.println("Please enter your age: ");
- byte age = user.nextByte();
- System.out.println("Please enter your email adress:");
- String email = user.nextLine();
- System.out.println("Please enter your password:");
- String password = user.nextLine();
- if (name.length() < 3 || name.contains("\\d+")) {
- System.out.println("Unproper name");
- } else
- System.out
- .println("Enetered name pass all tests you can countinue");
- if (age < 5 || age > 90) {
- System.out.println("Unproper years");
- } else
- System.out
- .println("Enetered years pass all tests you can countinue");
- if (password.length() < 5) {
- System.out.println("Unproper password");
- } else System.out.println("Enetered password pass all tests you can countinue");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement