This project is a Java-based desktop application designed for efficient management of a store's catalog, customer database, and transactions. It features a robust graphical user interface (GUI) alongside a text-based console mode for flexible usage scenarios.
The application focuses on creating a seamless user experience for both the store staff and customers by providing an intuitive platform for managing products, customers, and sales.
- Catalog Display: Displays a comprehensive list of products, including images, descriptions, and prices.
- Cart Operations:
- Add items to the cart with the desired quantity.
- Remove specific items or clear the entire cart.
- Bulk Purchase Discounts: Automatically applies a 10% discount for orders of 10 or more units of the same product.
- Sales Tax Calculation: Includes a 6% tax calculation applied to the subtotal at checkout.
- Customer Lookup: Quickly load existing customer details by providing a unique customer ID.
- New Customer Creation: Add new customers directly into the system.
- Transaction Records:
- Track the date and amount of the last transaction for each customer.
- Maintain a history of total purchase value for every customer.
- Persistent Data Storage: Reads customer data from
customers.txtat startup and saves updates to the same file.
- Payment Options:
- Full payment: Offers a 5% discount for upfront payment.
- Installment payment: Allows flexible partial payments.
- Invoice Generation:
- Generates detailed invoices summarizing purchases, discounts, tax, and payment details.
- Saves invoices to
invoice.txtfor record-keeping.
- A text-based interface replicating all features available in the GUI:
- Customer and product management.
- Cart operations.
- Payment handling and invoice generation.
- Java Swing: For building the graphical user interface.
- Java File I/O: For reading and writing data to and from files.
- Object-Oriented Programming (OOP): To model products, customers, and transactions effectively.
- Error Handling: Robust handling of edge cases like invalid inputs and empty cart scenarios.
products.txt:- Contains the product catalog with fields for product code, name, description, price, and icon image path.
- Updates dynamically as products are added or removed.
customers.txt:- Stores customer details such as ID, name, total purchases, and last transaction date.
- Supports creating and updating customer records.
invoice.txt:- Outputs a detailed invoice for each transaction, ensuring records of all sales are kept.
- Main Window:
- Displays the product catalog with product images, descriptions, and prices.
- Allows users to add/remove items from the cart.
- Cart Panel:
- Shows items added to the cart with quantities, prices, and total cost.
- Handles discounts for bulk orders and applies sales tax.
- Customer Panel:
- Supports loading or adding customer details for personalized service.
- Payment Panel:
- Offers full payment or installment options.
- Generates invoices and saves them for future reference.
- Mirrors the GUI functionality via a command-line interface.
- Provides step-by-step prompts to manage customers, products, and transactions.
- Offers a simpler yet efficient alternative for text-based environments.
-
Compile the Program:
javac Assignment4GUI.java
-
Run the Program:
- GUI Mode:
java Assignment4GUI
- Console Mode:
java Assignment4GUI console
- GUI Mode:
Assignment4GUI.java: Main program containing GUI implementation and logic for managing the catalog, customers, and transactions.products.txt: Stores product information, including name, price, description, and associated icons.customers.txt: Maintains customer records, including IDs, names, and purchase history.invoice.txt: Saves detailed invoices for each completed transaction.
- Use the GUI to quickly process customer transactions.
- Keep track of inventory and customer records seamlessly.
- Enjoy faster checkouts with personalized service.
- Receive detailed invoices for each purchase.
- Search Functionality: Add a search bar to filter products by name or category.
- Advanced Analytics: Generate sales reports and customer insights.
- Database Integration: Transition from file-based storage to a database for enhanced scalability.
This project is intended for educational purposes and is not licensed for commercial use.