Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions