https://github.com/devmarkson/exercise-on-singlylinkedlist
https://github.com/devmarkson/exercise-on-singlylinkedlist
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/devmarkson/exercise-on-singlylinkedlist
- Owner: DevMarkson
- Created: 2024-01-25T07:04:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T22:23:31.000Z (over 2 years ago)
- Last Synced: 2024-12-28T19:46:50.117Z (over 1 year ago)
- Language: Java
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shopping and Inventory Management System(Exercise on SinglyLinkedList)
## Overview
This program simulates the management of multiple sellers for various products, such as appleIPhone, earBuds, and keyboard. The seller list is maintained using a singly linked list, ordered by the total cost (product price plus shipping cost), with ties broken alphabetically by seller names. The system handles various events like adding sellers, removing sellers, updating inventory, customer purchases, and displaying seller lists.
## Instructions
To run the program, execute the `HW1.java` file with the input file name as a command-line argument. The input file should contain events that describe shopping and inventory actions.
## Input Format
The input file should contain the following types of events:
- `AddSeller product seller price shippingCost quantity [NonPositiveQuantityError]`
- `RemoveSeller product seller [NonExistingSellerError]`
- `IncreaseInventory product seller quantity updatedInventory`
- `CustomerPurchase product seller quantity updatedInventory or NotEnoughInventoryError`
- `DisplaySellerList product`
## Output Format
The program prints events to the standard output, and each event is on a separate line. Possible events include:
- `AddSeller product seller price shippingCost quantity [NonPositiveQuantityError]`
- `RemoveSeller product seller [NonExistingSellerError]`
- `IncreaseInventory product seller quantity updatedInventory`
- `CustomerPurchase product seller quantity updatedInventory or NotEnoughInventoryError`
- `DepletedInventoryRemoveSeller product seller`
- `DisplaySellerList product`
Additionally, the program outputs the seller details in the following format:
```
seller productPrice shippingCost totalCost
walmart 20.99 0.00 20.99
amazon 16.95 5.00 21.95
bestbuy 21.99 0.00 21.99
```