/** Practice with additional Swing Classes and Layout. */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.DecimalFormat; import java.util.*; public class EggShop extends JFrame { private OptionPanel eggPanel; private OptionPanel toppingPanel; private OptionPanel beveragePanel; private JLabel totalPrice; /** * Return the current order price as a string, formatted to two decimal * places. */ public String getCurrentPrice() { // COMPLETE ME! return ""; } /** * Return the total price of the order including 6% sales tax. */ public double getTotalPrice() { // COMPLETE ME! return 0.0; } /** * Update the window to display the current price */ public void updatePrice() { // COMPLETE ME! } /** * Create a new EggShop window */ public EggShop() { super("Order calculator"); this.setSize(400, 250); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setLayout(new BorderLayout()); Option[] eggtypes = { new Option("Sunnyside up", 2) // COMPLETE - Add remaining options here }; Option[] toppings = { new Option("Ketchup", 0.2) // COMPLETE - Add remaining options here }; Option[] beverages = { new Option("None", 0) // COMPLETE - Add remaining options here }; this.eggPanel = new OptionPanel(this, eggtypes, "Egg Choices", true); this.toppingPanel = new OptionPanel(this, toppings, "Toppings", false); this.beveragePanel = new OptionPanel(this, beverages, "Beverages", true); this.add(eggPanel, BorderLayout.WEST); this.add(toppingPanel, BorderLayout.CENTER); this.add(beveragePanel, BorderLayout.EAST); // COMPLETE - Add top Welcome panel and bottom Total Price panel this.setVisible(true); } public static void main(String[] args) { EggShop e = new EggShop(); } }