Rutgers CS 213

RU Burgers

A restaurant ordering app, built twice: once for the desktop with JavaFX and once for Android.

Customers build burgers, sandwiches, sides and drinks with add-ons, combine them into combos, review the current order and place it, and the store keeps an order history. Every item knows its own price, and the order adds them up with New Jersey sales tax.

Both versions share the same model classes for menu items and orders. The desktop app draws them with JavaFX views and controllers, and the Android app with activities and fragments.

Desktop app

JavaFX views and controllers

Android app

Activities and fragments

Shared model

Menu items, combos, orders

  • Desktop app and Shared model
  • Android app and Shared model
Simplified to the main pieces and how they talk to each other.

See it work

The menu as classes

MenuItem

Abstract: price()

Sandwich

Bread, protein, add-ons

Burger

Extends Sandwich

Beverage

Size, flavor

SideOrder

Combo

Sandwich, drink, side

Order

List of items, subtotal, tax

  • Order to MenuItem: holds
  • MenuItem to Sandwich
  • Sandwich to Burger
  • MenuItem to Beverage
  • MenuItem to SideOrder
  • MenuItem to Combo
Every item extends MenuItem and works out its own price(), so an order can total anything on the menu the same way.

Pricing rules, from the code

RuleHow it's priced
Double pattyProtein price + $2.50
ComboSandwich + drink + small side, minus $1.00
Sales tax6.625% of the subtotal, New Jersey's rate