Answered step by step
Verified Expert Solution
Link Copied!

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 '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
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

=+3. Which factors do influence the procurement management?

Answered: 1 week ago

Question

=+1. Describe the product range in the press sector!

Answered: 1 week ago