Build an order model. Items are added only through addItem, and the total must always equal the sum of the items (unit price × quantity). Complete Order.
Complete a plain-Java (no framework) Order model. Items are added only through a designated method, and the total must always equal the sum of the items (unit price × quantity). You practice verifying that an object keeps its own rule (total = sum of items).
An object should be able to keep the rules it is responsible for (for example, total = sum of items) on its own. This problem completes an Order model that keeps the total equal to the sum of items as items are added through its designated method, and verifies in real code that the total always equals the sum of items.