Question: The program begins with a login screen, prompting the user to enter a username and password. Valid users include 'ahmet' with password ' 1 2

The program begins with a login screen, prompting the user to enter a username and password. Valid users include 'ahmet' with password '1234', 'zeynep' with password '4444', and an administrator 'admin' with password 'qwerty'. After three consecutive failed login attempts, an account is blocked.
Upon successful login, the user is greeted with a menu:
1. Search and Add to Basket
2. View Basket
3. Checkout
4. Logout
5. Exit
Option 1 allows the user to search for products by entering keywords. Matching items with positive stock amounts are displayed, and the user can add items to their basket. The program checks if the requested amount exceeds the stock and prompts for a valid amount. Empty search results lead to a new search prompt.
Option 2 shows the user's basket content, item prices, amounts, and the total cost. A sub-menu allows updating item amounts or removing items.
Option 3(or main menu item 3) proceeds to checkout, displaying a receipt with the current date and time. Inventory stock amounts are appropriately reduced.
Option 4 logs the user out, preserving the basket content. Upon login, the user sees items added in previous sessions.
Option 5 exits the program.
For the admin, upon valid credentials, a separate menu is presented:
1. Reactivate Blocked User
2. Deactivate User
3. Add New User
4. Remove User
5. Logout
6. Exit
Option 1 reactivates a blocked user by resetting failed login attempts.
Option 2 allows the admin to deactivate (block) a user account.
Option 3 permits adding a new user.
Option 4 enables the admin to remove a user.
Option 5 logs out the admin, requiring login credentials again.
Option 6 exits the program.Implementation Notes:
A data structure must be used to keep user account information.
A data structure must be implemented for the basket.
Whenever an operation is performed by the user, the above data structures should be
updated properly to reflect the changes.
An additional data structure will be used for the Market's inventory. The inventory is
as follows
 The program begins with a login screen, prompting the user to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!