Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this course is data structure and algorithm c++ use the following code to help you with the following everything you need to know is in

this course is data structure and algorithm c++ use the following code to help you with the following everything you need to know is in the screenshots do part 1 2 3 and 4 you can use the code to help you wo write the code thanks

#include #include using namespace std; class CPUProcess{ private: string process_name; . . . public: CPUProcess(string pn,...){ process_name = pn; . . . } void printProcessInfo(){ .... } }; template class ProcessNode{ public: ..... } template class StackLL{ ProcessNode* head; ProcessNode* top; public: StackLL(){ head = NULL; top = NULL; } bool pushProcess(T process){ ProcessNode* newNode = new ProcessNode(process); .... } CPUProcess lateProcess(){ .... } . . . . }; template class QueueLL{ ProcessNode* head; ProcessNode* front; ProcessNode* rear; int capacity = 3; public: QueueLL(){ head = NULL; front = NULL; rear = NULL; } bool execute(T process){ ProcessNode* newNode = new ProcessNode(process); .... } void cpuSchedule(){ .... } void killProcess(){ // You need to create an object of type StackLL so that you can // call the pushProcess(T process) method here. .... } . . . . };

// If you will solve the bonus part (Binary Tree) your code will be below // // //

int main() { CPUProcess p1(1,"p1",10); CPUProcess p2(2,"p2",4); CPUProcess p3(3,"p3",1); CPUProcess p4(4,"p4",5); CPUProcess p5(5,"p5",15); QueueLL qll; qll.execute(p1); qll.execute(p2); qll.execute(p3); qll.execute(p4); qll.execute(p5); qll.cpuSchedule(); qll.killProcess(); StackLL sll; sll.stackOfProcesses(); sll.lateProcess().printProcessInfo(); return 0; }

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

- Client Class (5 Points) - This class will contain the following attributes, string clientName, string clientEmail, string clientPhone, stringClientAddress, string clientPassword, int clientID, and array of type Transaction with size 5 . - Implement all the setters and getters for the above attributes, implement a parameterized constructor to take the clientName, clientEmail, clientPhone, and clientAddress and set them to the class attributes. - Implement a method to print the client info, except the password and the list of transactions. - LinkedListNode Class (2 Point) - This class is to represent the linked list node, it will be of type Client, the node will have two attributes, data part and next part, and one constructor to take the data and set it and next = NULL. - ClientsLinkedList Class (2 Points) - This is the class representing the linked list of clients, with two attributes, head and listSize, and one constructor to set the head = NULL. - Transaction Class (3 Points) - This class is to represent the transaction, with the attributes: int transactionID, string transactionName, string transactionDate (e.g., transactionDate = "14/Dec/2022"). - Implement getters and setters for this class and the parameterized constructor, and a function to print the transaction info. - Array of Clients: (3 Points) - This part you need to initialize an array of size 10, the array type is LinkedListNode because each index in the array will contain a pointer to a linked list. See thic imnara farmana infarmation Part \#2: Menus You need to create a method for each of the following menus: - void mainMenu(): see the image below (3 Points) +t+t+t+t+t+t+t+t+t++ We lcome to the Banking System +t+t+t+t+t+t+t+t+t+t+t+t CHOOSE ONE OF THE FOLLOWING OPTIONS 1. Login to your account 2. New client? 3. Forgot your password? 4. Sort clients by linked list size using the Quick Sort Algorithm 4. Exit the program - void loginMenu(): see the image below (3 Points) - void newClientMenu(): see the image below (3 Points) - void newClientMenu(): see the image below (3 Points) - void transactionsMenu(): see the image below (3 Points) - void clientHome(): see the image below (3 Points) ++++++++++++++++++ We lcome to the Banking System +++++++++++++++++++++++ - The first menu should appear is the mainMenu(), user can login by email and password from the loginMenu(), or if the user is new, he/she can create a new account using the newClientMenu(), user can create a transaction through the transactionsMenu(). (5 Points) - You must handle all moves from one menu to another, user must be able to go back from any menu to the mainMenu(), you must handle exception cases. (3 Points) - Forget password part, the user will write correct and exist email, then you will print the related password with this account. (2 Points) Part \#3: Program Logic A client will login to the system, by writing the correct email and password, then you will show the clientHome() menu, a client can go to the transactions page, view all personal info except the password, or log out. In log out, you will go back to the mainMenu(). You must handle an array of size 10 (Refer to part \#1), to store the clients, each index of this array will point to a linked list of clients, while creating a new account, a new client will be added to the system, so after taking the entered information from the user - as showed in the newClientMenu () - in addition to clientID which will be generated automatically using a RANDOM function, you have to hash/assign this new client to a specific index of the array, so the client will be added to the end of the linked list in that array index. Using linked list here will help us avoid the collision problem, as more than one client might be mapped to the same array index. (25 Points) As in the mainMenu() you have the option to sort the array of linked lists by the linked list size help us avoid the collision problem, as more than one client might be mapped to the same array index. (25 Points) As in the mainMenu() you have the option to sort the array of linked lists by the linked list size using the Quick Sort Algorithm, then view each array index after sorting and print the clients in the linked list. (See the image below for more info) (15 Points) After sorting the array of linked lists, we have the following info Index \#1: Linked List of 0 clients. Index \#2: Linked List of 1 clients. clients of index \#2: client . . Linked List of 2 clients. clients of index \#3: client . client . Client Linked List of 3 clients. clients of index \#4: client ............... Index \#5: Linked List of 3 clients. Index \#6: Linked List of 4 Clients. Index \#7: Linked List of 6 Clients. Index \#8: Linked List of 7 clients. Index \#10: Linked List of 7 clients. If a new client tried to create an account using the same email, you should show an error message and not add the client to the system. (3 Points) After creating the account successfully, you will go back to the mainMenu() then the client can login using the created info. (2 Point) In the clientHome() menu, if the client chose the transactionsMenu() he/she can create a new transaction, in the point you don't have to take info from the user, just create a new object with static data and add the transaction to the array of transactions related to this client, client can't create more than 5 transactions. (3 Points) To view the transactions, you just need to view the array of transactions, to delete a transaction client must type the transaction id, and if it is correct, delete it. (2 Points) Part \#4: Bonus Part (15 Points) Sort each linked list by the id of the clients, then print the clients of each linked list and the number of clients in that list. (You will create an option in the mainMenu() for this part)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

5. Describe how contexts affect listening

Answered: 1 week ago