Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Text - based User Interface: When your program first runs, it will ask the user to log in by providing a user name and password

Text-based User Interface:
When your program first runs, it will ask the user to log in by providing a user name and
password as follows. In your code, at least, the following users should be already defined with
user name ahmet and password 1234, and zeynep with password 4444. You will have
one administrator account with name admin and password qwerty You may define
additional users if you like.
1
****Welcome to Medipol Online Market****
Please log in by providing your user credentials:
User Name:
If the user enters invalid credentials, the program should ask the user to try again. The
user successfully logs in when the provided credentials are valid, if the user enters invalid
credentials for the same user 3 time in row, the account will be blocked and the user will not
be allowed to login. The program will warn the user in such a case. The following shows
the interface for the initial login screen with a scenario where the user first enters incorrect
credentials, and then successfully logs in during the second trial.
****Welcome to Medipol Online Market****
Please log in by providing your user credentials:
User Name: ahmet
Password: 123
Your user name and/or password is not correct. Please try again!
User Name: ahmet
Password: 1234
Successfully logged in!
The following shows the interface for the initial login screen again with a scenario where the
user enters 3 incorrect credentials, and then a warning message will be shown. (Note: Even
if the user tries to log in later, their account should remain blocked)
****Welcome to Medipol Online Market****
Please log in by providing your user credentials:
2
User Name: ahmet
Password: 123
Your user name and/or password is not correct. Please try again!
User Name: ahmet
Password: 132
Your user name and/or password is not correct. Please try again!
User Name: ahmet
Password: 132
Your user name and/or password is not correct.
Your account has been blocked. please contact the administrator.
Once the user enters valid credentials, your program should greet the user with the following
message, and provide a menu of the options to do. User will do a selection by entering the
corresponding menu number, and accordingly different information will be shown and/or
requested.
Welcome, ahmet! Please choose one of the following options by entering the corresponding
menu number.
Please choose one of the following services:
1. Search for a product
2. See Basket
3. Check Out
4. Logout
5. Exit
Your Choice
If the user enters an invalid menu entry, the program should warn the user to provide a valid
menu number
When main menu item 1 is chosen, the user will be asked to provide search term(s). Then,
your program will display a list of all items from inventory whose name includes the user-
3
provided search term(s), and whose stock amount is greater than 0. For instance, when the
user searches for Juice, the program should display all items whose name includes juice
and available in the stocks as follows. Product name checking should be case insensitive
(i.e., you should not differentiate between lower and upper case letters).
Please choose one of the following Services:
1. Search for a product
2. See Basket
3. Check Out
4. Logout
5. Exit
Your Choice: 1
What are you searching for? Juice
found 3 similar items:
1.grape juice 9$
2.orange juice 9$
3.apple juice 9$
Please select which item you want to add to your basket (Enter 0 for main menu):
Note that each matching item is assigned a number, and the program asks the customer to
enter the number corresponding to a product to add to his/her basket. A customer may
cancel the current search session and go back to main menu by entering 0 at this stage. Once
the customer chooses a product to add to the basket, the program will ask for the amount.
If the requested amount is not exceeding the stock amount of the selected product in the
inventory, the product should be added to the basket, and the customer should be notified
about it, and then the main menu should be displayed.
Please select which item you want to add to your basket (Enter 0 for main menu): 3
4
Adding apple juice. Enter Amount: 2
Added apple juice into your Basket.
Going back to main menu...
Please choose one of the following services:
1. Search for a product
2. See basket
3. Check out
4. Logout
5. Exit
Your Choice:
If the requested amount is over the stock amount, then the program should ask the user to
provide another amount (or Enter 0 to go back to main menu).
Please select which item you want to add to your basket (Enter 0 for main menu): 1
Adding grape juice. Enter Amount: 1000
Sorry! The amount exceeds the limit, Please try again with smaller amount
Amount (Enter 0 for main menu):
If the search result is empty, the user will be requested to provide another search term (or,
the user may go back to main menu by entering 0).
What are you searching for? Lemon

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

Explain what LIFO means.

Answered: 1 week ago

Question

Evaluate continuous monitoring techniques and alarms.

Answered: 1 week ago

Question

Understand cloud-based collaboration platforms.

Answered: 1 week ago