Question: This will be performed on netbeans if that matters This program in java asks you to implement online grocery shopping that has the following functions:

This will be performed on netbeans if that matters

This program in java asks you to implement online grocery shopping that has the following functions:

Create a new account

Add items

Purchase items

Return the items

Track customer transactions

Description

First of all, you have to create a database with the following items when you run the system.

You need to use data structure to save the items. Here are sample data:

11012 gallon milk 1.99 N

11014 butter 2.59 N

11110 pie shells 0.99 N

20115 laundry soap 3.60 T

30005 home style bread 0.99 N

40000 Organic Eggs 2.99 N

40020 Organic Chicken Broth 3.99 N

11110 pie shells 0.99 N

The last column decides the whether the product is taxable or not. 'T' if the product is taxable; 'N' if it is not taxable.

You have to check the product duplication when you add the new item into the stock. Each item id should be unique. Each item id does not start with zero and consists of 5 digits. The data type of price is float. The valuse of tax are either T or F only.

In order for customer to purchase the product through the onlie grocery store, he (she) must create his (her) account first. To simplify, only two information are rquired: customer id and password.

Data Validation rules:

Customer id must begin with alphabet.

Customer password must the combination of uppercase, lowercase, digit and symbols.

Both customer id and password will be used for user validation when user logins into the system.

Customer should login into the system first with customer id and password and then check whether this customer is valid or not. Only valid customer can do this online shopping.

After successfully login, the system displays the product information to the screen and then asks customers to enter data in the following format:

is a positive number. The system checks that the entered items is in the stock. If exists, the program can process the transaction. Otherwise, write an error message to the receipt, ignore the entered item number, and continue to wait for the next order. This transaction keeps working until the customer enters DONE.

At the end of each customer's order, each purchased items, the number of items, item prices, the subtotal for all items, and amount of tax on taxable items. (The tax rate is 5% for taxable items.).

Whenever a customer purchases or returns the items, custmerid, prductid, pirce, quantity, tax, purchasedDate, returnDate should be recorded into transaction list. The purchasedDate or returnDate should be entered manually. This transaction list will be used for tracking customers transactions for the future work.

There is a return policy. The customer can return the purchased items and fully be refunded only within 3 months from the purchase Date.

Sample: Main Menu

Create a new account

Purchase Items

Return Items

View Transaction History

Exit

Login Menu:

User ID:

Password:

After log into the system successfully, the customer looks at the following product list:

Sample Grocery Items:

11012 gallon milk 1.99 N

11014 butter 2.59 N

11110 pie shells 0.99 N

20115 laundry soap 3.60 T

30005 home style bread 0.99 N

40000 Organic Eggs 2.99 N

40020 Organic Chicken Broth 3.99 N

11110 pie shells 0.99 N

Customer enters product and quantity:

11110 2

40012 3

20115 1

DONE

When the customer enters DONE, the receit has been displayed to the screen:

Receipt Output:

Transaction Time: 10:10, 1/20/2018

Customer ID: C0001

Customer Name: Jackie Brown

--------------------------------------------------

pie-shells 2 0.99 1.98

*** item 40012 not in inventory ***

laundry-soap 1 3.60 3.60 TX

Earned Points: 0.117

Subtotal: 5.58

Tax: 0.27

Total: 5.85

Note:

Please do not use exception handlings in your program.

Instructor will check Input validation, Integer error, and Buffer overflow (if any) when testing your program with several values.

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!