Question
Instructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove
Instructions
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
DebugFourteen2.java
// Displays list of payment options // - credit card, check or cash // Displays fee for using each - 5%, 2% or 0%
import javax.swing.*; import java.awt.*; import java.awt.event.*;
public class DebugFourteen2 extends JFrame implements ItemListener { FlowLayout flow = new FlowLayout(); JComboBox
----------------------------------------------------------------------------------
DebugFourteen3.java
// User selects pizza topping and sees price import javax.swing.*; import java.awt.*; import java.awt.event.*; public class DebugFourteen3 extends JFrame implements ItemListener { FlowLayout flow = new FlowLayout(); JComboBox
@Override public void itemStateChanged(ItemEvent list) { Object source = list.getSource(); if(source == pizzaBox) { int pizzaNum = pizzaBox.getSelectedIndex(); total = pizzaPrice[pizzaNum]; output = "Pizza Price $" + totPrice; totPrice.setTextValue(output); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started