CS300Fall19_Assignment4 CS 300 Data Structures Assignment-4 November 19, 2019 1 Due Date: Dec 2nd XXXXXXXXXX:50pm (Monday) User Authentication Controller In this assignment, you are asked to implement...

1 answer below »
please follow the requirement as stated in the file


CS300Fall19_Assignment4 CS 300 Data Structures Assignment-4 November 19, 2019 1 Due Date: Dec 2nd 2019 11:50pm (Monday) User Authentication Controller In this assignment, you are asked to implement a simple user authentication controller, where you can add/delete users, change passwords of the users, and log users in and out, list all registered and active users. Registered users are the ones added with adduser function, and active users are the ones that are logged in. A user must be registered to be added to the active users list with the login function. You are given a header file (AuthenticationController.h) which provides the public interface (core functionalities) of AuthenticationController class. Requirements: • You are asked to create and implement AuthenticationController.cpp file that includes implementations for all public functions provided in the header file. You can add private methods and fields, but don’t modify the public functions. You can also create other classes. • You are asked to create two hash tables. Table1 stores pairs of the registered users. Table1 will contain both old passwords and new password of the users. Table2 contains usernames of the active (logged in) users. • You are asked to use open addressing with double hashing in the implementation of hash table. Hash function implementation is provided in the header file. • If it is not possible to find an empty slot after a number of probes that is equals to the table size for a new entry, do not insert that entry. • [Optional Requirement] [+10 points]: In case of addUser, changePassword and login, if the load factor of the table is greater than MAX_LOAD_FACTOR, you are supposed to expand the table. New table size becomes the smallest prime number greater than 2*(tablesize). Don’t rehash the "DELETED" and "EMPTY" entries. CS 300 Data Structures Assignment-4 November 19, 2019 2 Sample state of Table 1 (order depends on the hash function, this is just a sample): "Fatma", password of Fatma "Alfred", password of Alfred "Margo" , password of Margo "Fatma", old password of Fatma "Sara", password of Sara "Margo" , old password of Margo ”Fatma", another old password of Fatma Sample state of Table 2: Fatma Margo Suggestion: Use vectors to implement tables instead of arrays. Here is a sample code. #include #include using namespace std; struct user{ string username; string password; }; int main(){ vector table; table.resize(10); //it is easier to resize with vectors user aUser; aUser.username ="Fatma"; aUser.password = "apassword"; table[0] = aUser; cout<>
Answered Same DayNov 21, 2021

Answer To: CS300Fall19_Assignment4 CS 300 Data Structures Assignment-4 November 19, 2019 1 Due Date: Dec 2nd...

Ria answered on Nov 26 2021
149 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here