Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Point of Sale UI Point of sale interfaces are designed to simplify the process o

ID: 3687367 • Letter: P

Question

Point of Sale UI

Point of sale interfaces are designed to simplify the process of making transactions, often in a retail environment. We often see them used in restaurants where managers can input the menu and waiters can quickly enter customer orders, which are transmitted to the kitchen and recorded. Modern systems usually include a touchscreen interface, which we will simulate with a mouse-based GUI.

The program you should design and build will read a menu from a text file formatted with a menu item and a price separated by a |. To simplify your text-parsing code, we will omit the dollar sign from the price.

For example:

The program should load the file at launch and create a panel full of large buttons (ideal for a touchscreen) for each menu item. A waiter should be able to click on each menu item to add it to the current order. This should add the item to a receipt panel which displays the full order and the total cost. The total cost should be accurate at all times, updated as each item is added (not only when the order is finalized).

The system only takes credit card as payment type however it can handle/validate multiple types of credit cards. (Please see credit card section below).

The waiter should be able to click a “Place Order” button that simulates transmitting the order to the kitchen by printing the order to System.out (in addition to showing the confirmation on screen). You should also include a “Clear” button that will clear the current order (used when a waiter makes a mistake and needs to start over).

Explanation / Answer

public class OddEvenSum { // Save as "OddEvenSum.java" public static void main(String[] args) { int lowerbound = 1, upperbound = 1000; int sumOdd = 0; // For accumulating odd numbers, init to 0 int sumEven = 0; // For accumulating even numbers, init to 0 int number = lowerbound; while (number