Question: // DebugFive1 // Adds your lunch bill // Burger and hot dog are $2.59 // Grilled cheese and fish are $1.99 // Fries are 89

// DebugFive1 // Adds your lunch bill // Burger and hot dog are $2.59 // Grilled cheese and fish are $1.99 // Fries are 89 cents import java.util.*; public class DebugFive1 { public static void main(String args[]) { Scanner input = new Scanner(System.in); final double HIGH_PRICE = 2.59; final double MED_PRICE = 1.99; final double LOW_PRICE = 0.89; String usersChoiceString; int usersChoice; double bill; System.out.println("Order please 1 - Burger 2 - Hotdog" + " 3 - Grilled cheese 4 - Fish sandwich"); usersChoiceString = input.next(); usersChoice == Integer.parseInt(usersChoiceString); if(usersChoice == 1 && usersChoice == 2) bill = bill + HIGH_PRICE; else bill = bill + MED_PRICE; System.out.println("Fries with that? 1 - Yes 2 - No"; usersChoiceString = input.next() usersChoice = Integer.parseInt(usersChoiceString); if (usersChoice = 1) bill = bill + LOW_PRICE; System.out.println("Bill is " + bill); } }
Debugging Exercise 5-1 Instructions DebugFive1 java+ DebugFive1.java:21: error: not a atenent nt(usersChoiceString); DebugFive1.java:26: error: )' e usersChoiceInteger.par 1 //DebugFive1 2 // Adds your lunch bill 3// Burger and hot dog are $2.59 4 /I Grilled cheese and fish are $1.99 S // Fries are 89 cents 6 import java.util.*; 7 public class DebugFive1 The f iles provided in the code editor to the tal right contain syntax and/or logic errors. In each case, determine and fix the problem, the program to ensure it works properly Grading cted h that? 1 Yesn2 No"; DebugFive1.java:27: error: ''e System.out.println("Fries remove all syntax and coding errors, and run cted usersChoiceStringinput public static void main(String args[]) 10 Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade Scanner input new Scanner (System.in); final double HIGH-PRICE = 2.59; final double MED PRICE 1.99 final double LOW PRICE .89; String usersChoiceString; int usersChoice; double bill; Systen.out.println("Order pleasen1 Burger n2 Hotdog"+ n3 Grilled cheese n4 Fish sandwich"); usersChoiceString = input.next(); usersChoiceInteger.parseInt (usersChoiceString); if(usersChoice == 1 && usersChoice-t 2) 3 errors Error: Could not find or load ma class DebugFive1 12 13 14 15 16 17 18 Once you are happy with your results, click the Submit button to record your score 20 21 bill bill HIGH PRICE; 23 24 25 26 27 28 29 30 else bill-bill MED_PRICE; Systen.out.println("Fries with that? n1 Yes n2 No" usersChoiceString input.next() usersChoice-Integer.parseInt(usersChoiceString); if (usersChoice 1) bill bill LOW PRICE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
