Week 1 — Pizza POS Terminal
Terminal Utility · Java
The Idea
You work at a pizzeria. You use a POS system every shift. And you already know exactly what's wrong with it.
That's the starting point for this project: build the version you actually want. A terminal-based point-of-sale system that handles taking orders, customising items, tracking what's been ordered, and printing a ticket. No bloated interface, no mystery buttons — just something that works the way a busy shift needs it to.
The design challenge is that a menu isn't one kind of thing. A pizza is completely different from a drink — it has a size, it has toppings, and its price depends on choices made at order time. A drink is simpler. A side dish is simpler still. But when you're totalling an order or printing a receipt, you don't want to treat them differently — you just want to loop through the items and ask each one for its price and its description.
You decide what the menu looks like, what items you support, what customisation options exist, and how the interface feels. The only constraint is that all menu items work through the same system when it comes to pricing and display.
Week 1 — Build Your Menu Item Hierarchy
This week is about the menu — modelling the items before worrying about orders, queues, or the full interface.
This week's topic: classes and subclasses.
You need to capture that all menu items share some structure (a name, a price, a way to describe themselves) but differ significantly in how their price is calculated and what their description contains.
You need:
- An abstract base class
MenuItemthat holds what every item has in common. The methods that differ per item type — at minimumgetPrice()andgetSummary()— should be declared abstract. - At least three concrete subclasses: one for pizzas (with size and topping logic), one for drinks, and one for sides. Each must hold the fields relevant to its own pricing logic.
- An
Orderclass (not a subclass ofMenuItem) that holds a list of items, an order ID or table number, and methods to add items and calculate the total. - A basic CLI loop where the operator can add items to an order by name and see a running total.
By the end of week 1 you should be able to start the program, add a pizza, a drink, and a side to an order, and see the correct total printed.
What you decide:
- What items are on your menu and what they cost
- How pizza sizing and toppings affect the price
- Whether drinks have sizes, whether sides have portion options
- What the order summary looks like when printed
Think back to your own frustrations with the current system. Even week 1 is a chance to make something that already feels more logical.