(Marks:40) Task 1 – Registration and login feature At the end of this specific task, students should be able to: Create
Posted: Sat May 14, 2022 8:39 pm
Please use Java and make use
of JOptionPane.showInputDialog
(Marks:40) Task 1 – Registration and login feature At the end of this specific task, students should be able to: Create classes, methods, and other OOP programming constructs. Use decisions Produce an application that accepts input and returns output (Learning unit 1-4) . Your very first task is to create a registration and login feature. This feature needs to allow users to (Read through the entire task before you start any work): 1. Create an account by entering username, password, first name and last name. a. The system needs to check that the following conditions are met, and reply with the appropriate output message:
Conditions Messages True False Username contains an underscore and is no more than 5 characters long "Username successfully captured" "Username is not correctly formatted, please ensure that your username contains an underscore and is no more than 5 characters in length." "Password is not correctly formatted, please ensure that the password contains at least 8 characters, a capital letter, a number and a special character." "Password Password meets the following password complexity rules, the password must be: successfully captured" At least 8 characters long Contain a capital letter Contain a number Contain a special character 2. Login to the account using the same username and password. The system should provide the following messages to verify the user's authentication a. state: Conditions Messages True False "Welcome <user first "Username or The entered username and password are correct, and the user is able to log in. name>,<user last password incorrect, please try again name> it is great to see you again. 3. You will need to implement a Login class with the following methods to ensure that your application meets good coding standards and that the code you write is testable.
Method Name Boolean:checkUserName) Method Functionality This method ensures that any username contains an under score and is no more than This method ensures that passwords meet the following password complexity rules, the password must be: Boolean: checkPassword Complexity() String registerUser() At least eight characters long. Contain a capital letter Contain a number Contain a special character This method returns the necessary registration messaging indicating it: The username is incorrectly formatted The password does not meet the complexity requirements. The two above conditions have been met and the user has been registered successfully. This method verifies that the login details entered matches the login details stored when the user registers. This method returns the necessary messaging for: A successful login A failed login Boolean login User() String returnLoginStatus 4. It is good practice to never push code that has not been tested, you will need to create the following unit tests to verify that your methods are executing as expected: Test: (assertEquals) Test Data and expected system responses. Username is correctly formatted: Test Data: "kyl_1" The username contains an underscore and is no The system returns: more than 5 characters long "Welcome <user first name>,<user last name> it is great to see you." Username incorrectly formatted: Test Data: "kyle!!!!!!!"
The username does not contain an underscore and is no more than 5 characters long The system returns: "Username is not correctly formatted, please ensure that your username contains an underscore and is no more than 5 characters in length." Test Data: "Ch&&sec@ke99!" The password meets the complexity requirements The system returns: "Password successfully captured" Test Data: "password" The password does not meet the complexity requirements The system returns: "Password is not correctly formatted, please ensure that the password contains at least 8 characters, a capital letter, a number and a special character." Test (assertTrue/False) Login Successful The system returns: True Login Failed The system returns: Username correctly formatted False The system returns: True The system returns: Username incorrectly formatted False Password meets complexity requirements The system returns: True Password does not meet complexity The system returns: requirements False
of JOptionPane.showInputDialog
(Marks:40) Task 1 – Registration and login feature At the end of this specific task, students should be able to: Create classes, methods, and other OOP programming constructs. Use decisions Produce an application that accepts input and returns output (Learning unit 1-4) . Your very first task is to create a registration and login feature. This feature needs to allow users to (Read through the entire task before you start any work): 1. Create an account by entering username, password, first name and last name. a. The system needs to check that the following conditions are met, and reply with the appropriate output message:
Conditions Messages True False Username contains an underscore and is no more than 5 characters long "Username successfully captured" "Username is not correctly formatted, please ensure that your username contains an underscore and is no more than 5 characters in length." "Password is not correctly formatted, please ensure that the password contains at least 8 characters, a capital letter, a number and a special character." "Password Password meets the following password complexity rules, the password must be: successfully captured" At least 8 characters long Contain a capital letter Contain a number Contain a special character 2. Login to the account using the same username and password. The system should provide the following messages to verify the user's authentication a. state: Conditions Messages True False "Welcome <user first "Username or The entered username and password are correct, and the user is able to log in. name>,<user last password incorrect, please try again name> it is great to see you again. 3. You will need to implement a Login class with the following methods to ensure that your application meets good coding standards and that the code you write is testable.
Method Name Boolean:checkUserName) Method Functionality This method ensures that any username contains an under score and is no more than This method ensures that passwords meet the following password complexity rules, the password must be: Boolean: checkPassword Complexity() String registerUser() At least eight characters long. Contain a capital letter Contain a number Contain a special character This method returns the necessary registration messaging indicating it: The username is incorrectly formatted The password does not meet the complexity requirements. The two above conditions have been met and the user has been registered successfully. This method verifies that the login details entered matches the login details stored when the user registers. This method returns the necessary messaging for: A successful login A failed login Boolean login User() String returnLoginStatus 4. It is good practice to never push code that has not been tested, you will need to create the following unit tests to verify that your methods are executing as expected: Test: (assertEquals) Test Data and expected system responses. Username is correctly formatted: Test Data: "kyl_1" The username contains an underscore and is no The system returns: more than 5 characters long "Welcome <user first name>,<user last name> it is great to see you." Username incorrectly formatted: Test Data: "kyle!!!!!!!"
The username does not contain an underscore and is no more than 5 characters long The system returns: "Username is not correctly formatted, please ensure that your username contains an underscore and is no more than 5 characters in length." Test Data: "Ch&&sec@ke99!" The password meets the complexity requirements The system returns: "Password successfully captured" Test Data: "password" The password does not meet the complexity requirements The system returns: "Password is not correctly formatted, please ensure that the password contains at least 8 characters, a capital letter, a number and a special character." Test (assertTrue/False) Login Successful The system returns: True Login Failed The system returns: Username correctly formatted False The system returns: True The system returns: Username incorrectly formatted False Password meets complexity requirements The system returns: True Password does not meet complexity The system returns: requirements False