Task 1 - Registration and login feature (Marks:40) 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: 21:22:28 3032 Messages True "Username successfully captured" "Password successfully captured" Conditions Username contains an underscore and is no more than 5 characters long Password meets the following password complexity rules, the password must be: At least 8 characters long Contain a capital letter Contain a number Contain a special character False "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."
Login to the account using the same username and password. a. The system should provide the following messages to verify the user's authentication state: Conditions Messages True False The entered username and password are Username or correct, and the user is able to log in. password incorrect, "Welcome user first namexcuser last name it is great to see you again. please try 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 21, 22:23 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 At least eight characters long Contain a capital letter Contain a number Contain a special character This method returns the necessary registration messaging indicating if 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 2. Method Name Boolean: checkUserName() Boolean checkPasswordComplexity String registerUser() Boolean loginUser() 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 cuser first names cuser last name it is great to see you." Test Data: "kyle!!!! Username incorrectly formatted: 21:22:21 The username does not contain an underscore The system returns: and is no more than 5 characters long "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@ke991 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: False Username correctly formatted The system returns: True Username incorrectly formatted The system returns: False Password meets complexity requirements The system returns: True Password does not meet complexity The system returns: requirements False