Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 'zeynep' with password 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:
Search and Add to Basket
View Basket
Checkout
Logout
Exit
Option 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 shows the user's basket content, item prices, amounts, and the total cost. A submenu allows updating item amounts or removing items.
Option or main menu item proceeds to checkout, displaying a receipt with the current date and time. Inventory stock amounts are appropriately reduced.
Option logs the user out, preserving the basket content. Upon login the user sees items added in previous sessions.
Option exits the program.
For the admin, upon valid credentials, a separate menu is presented:
Reactivate Blocked User
Deactivate User
Add New User
Remove User
Logout
Exit
Option reactivates a blocked user by resetting failed login attempts.
Option allows the admin to deactivate block a user account.
Option permits adding a new user.
Option enables the admin to remove a user.
Option logs out the admin, requiring login credentials again.
Option 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started