-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.java
37 lines (36 loc) · 1.19 KB
/
test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Scanner;
public class test
{
public static void main(String[] args)
{
// greating line...
System.out.println("Hello and welcome to our CodeCamp.org ");
// register the user
String usrName, password, email;
// scanner for user input
Scanner s = new Scanner(System.in);
// prompt for user name
System.out.print("Enter your user name : ");
// get user name
usrName = s.next();
// prompt for user password
System.out.print("Enter your password : ");
// get user password
password = s.next();
// prompt for email
System.out.print("Enter your email address : ");
// get email address
email = s.next();
// Closing the scanner.
s.close();
// validate input
if (usrName != "" && password != "" && email != "")
{
System.out.println("\n-----------------------\nRegistration sucesfull\n-----------------------\n");
}
else
{
System.out.println("\n-----------------------\nRegistration failed\n-----------------------\n");
}
}
}