src/
βββ main/
βββ app/ β Contains the main class `PizzaTester`
βββ model/ β Core classes: `Pizza`, `Order`, `Customer`, `InvalidPizzaException`
βββ enums/ β Enum definitions for all types (Meat, Veggie, etc.)
-
Open terminal in
src/main/ -
Compile the classes
javac app/*.java model/*.java enums/*.java
-
Run the main app
java app/PizzaTester.java
- Youβll be asked how many pizzas you want to order.
- For each pizza, enter:
- Number of slices
- Meat, Veggie, Crust, Size
- One or more toppings (comma-separated)
- Enter customer name, address, and phone number.
- Choose delivery or pickup.
- Your order is saved to
pizza_orders.jsonand displayed on screen. - The system auto-loads and shows previous orders every time it starts.
Orders are saved in a human-readable format to pizza_orders.json
Each order includes:
- Order ID and timestamp
- Customer details
- List of pizzas with price breakdown
- Delivery/pickup option
- Grand total with discount if applicable
- Input is case-insensitive, but enum values must match predefined options.
- A 5% discount is applied if you order more than one pizza.
- Invalid entries throw friendly custom exceptions.
- Orders are appended, not overwritten β youβll always have your order history!