Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Stuck on a Java project. Having issues with setting up button listeners for a list and my panes seem to overlap. Any help / suggestions

Stuck on a Java project. Having issues with setting up button listeners for a list and my panes seem to overlap. Any help / suggestions would be appreciated!

You are a proud owner of your shop. Identify what kind of shop it is: a book shop, flower shop, automotive repair shop, a fast-food joint, a health/fitness equipment shop

Now that you have settled in with what your shop does, identify a list of things that you would like to sell in the shop. In case of a book shop, this would a list of books that you are selling. In order to sell, you would need to know the title of the book, the cost of each book, the number of books currently in stock.

You will need to create a static file (a text file in notepad), where each line includes the name of item, its price and number in stock. The entries in each line are separated by a ,. Such files are typically referred to as comma separated value (csv) files.

Here is an example of how entries can be stored in a File (Book.txt)

Jungle Book, 10, 6

Harry Potter, 15, 5

Java Programming, 50, 10

Now that you have the file about what you are selling in the shop for the day, you can start with your application.

Your application should have:

a title.

Menu with the following entriesFile.

Entries under File should be Save, Exit

Report

Inventory

Re-order

Sales

A JList to show the List of Items in the Shop.

4 buttons Add, Remove, Edit, CheckOut.

JList to show a Shopping Cart.

Functionality

When the application is started, the items in the shop should be listed in the JList.

When Add Button is clicked the Item selected in the ListBox should be added to the Cart, a dialog box should ask for the number of items needed and the Style of that item. (Example paperback/hardbound, Small/Large)

At any point, the user should be able to select an item from the cart and

remove it - By Clicking the Remove Button

Edit it By Clicking the Edit Button.

When Checkout Button is Clicked:

it should print the total cost and ask if the Customer wants to continue (Yes/No)

If Yes is Clicked, the transaction is complete. It should update the inventory, and clear the Shopping cart.

If No is clicked, then you return to the original screen to Edit the cart.

Menu functionalities

When the user clicks on File+ Save, it should save the file with the current inventory count. The filename can be the same as that of the input file.

When the user clicks on File + Exit, it should Exit the application.

When the user clicks on Report + Inventory, it should display the current inventory for each item in the shop. Each item should be listed in a separate line.

When the user clicks on Report + Re-order, it should display the items to be re-ordered i.e. those whose available count is less than 5.

When the user clicks on Sales, it should display the items sold and the total quantity sold for each. The last line should display the total dollar amount of the sales.

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago