Identify errors from the following program and correct them.       import java.swing.*; import java.awt.*; public class Cake extends Panel { public final double CREAM_CHEESE = 0.50 public final double BUTTER = 0.25; public final double PEACH_JELLY = 0.75; public final double BLUEBERRY_JAM = 0.75; private JCheckBox creamCheese;  private JCheckBox butter;       private JCheckBox peachJelly;   private JCheckBox blueberryJam; public Cake() { setLayout new GridLayout(4, 1)); creamCheese = new JCheckBox("Cream cheese"); butter = new JCheckBox("Butter"); peachJelly = new JCheckBox("Peach jelly"); blueberryJam = new JCheckBox("Blueberry jam"); setBorder(BorderFactory.createTitledBorder("Cake Decorations")); add(creamCheese); add(butter); add(peachJelly); add(blueberryJam); } public double getDecorationCosts() { double decorationCosts = 0; if (creamCheese.isSelected()) decorationCosts += CREAM_CHEESE; if (butter.isSelected()) decorationCosts += BUTTER; if (peachJelly.isSelected()) decorationCosts += PEACH_JELLY; if (blueberryJam.isSelected()) decorationCosts += BLUEBERRY_JAM; return decorationCosts;   }   One error is already identified for you as shown below: Line Number: 5 Error description: Missing semicolon Statement after correction: public final double CREAM_CHEESE = 0.50;   Identify 5 other errors and give their Line Number, Error description and Statement after correction in the following table. Line Number Error description Statement after correction

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
  1. Identify errors from the following program and correct them.

      import java.swing.*;

  1. import java.awt.*;
  2. public class Cake extends Panel
  3. {
  4. public final double CREAM_CHEESE = 0.50
  5. public final double BUTTER = 0.25;
  6. public final double PEACH_JELLY = 0.75;
  7. public final double BLUEBERRY_JAM = 0.75;
  8. private JCheckBox creamCheese; 
  9. private JCheckBox butter;      
  10. private JCheckBox peachJelly;  
  11. private JCheckBox blueberryJam;
  12. public Cake()
  13. {
  14. setLayout new GridLayout(4, 1));
  15. creamCheese = new JCheckBox("Cream cheese");
  16. butter = new JCheckBox("Butter");
  17. peachJelly = new JCheckBox("Peach jelly");
  18. blueberryJam = new JCheckBox("Blueberry jam");
  19. setBorder(BorderFactory.createTitledBorder("Cake Decorations"));
  20. add(creamCheese);
  21. add(butter);
  22. add(peachJelly);
  23. add(blueberryJam);
  24. }
  25. public double getDecorationCosts()
  26. {
  27. double decorationCosts = 0;
  28. if (creamCheese.isSelected())
  29. decorationCosts += CREAM_CHEESE;
  30. if (butter.isSelected())
  31. decorationCosts += BUTTER;
  32. if (peachJelly.isSelected())
  33. decorationCosts += PEACH_JELLY;
  34. if (blueberryJam.isSelected())
  35. decorationCosts += BLUEBERRY_JAM;
  36. return decorationCosts;
  37.  
  38. }

 

One error is already identified for you as shown below:

Line Number: 5

Error description: Missing semicolon

Statement after correction: public final double CREAM_CHEESE = 0.50;

 

Identify 5 other errors and give their Line Number, Error description and Statement after correction in the following table.

Line Number

Error description

Statement after correction

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Expert Solution
Step 1

We need to identify 5 errors and give their Line Number, Error description and Statement after correction in the following table.

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY