a. DebugOne1.java
Explanation of Solution
Errors in the given program:
In the given program “DebugOne1.java”, there are two errors, they are,
- The block comment section is not closed in Line 3.
- The keyword “static” is missing in Line 4.
- The highlighted lines are the corrected statements in the given program.
Corrected Program:
// Class definition
public class FixDebugOne1 // Line 1
{ // Line 2
/* This program displays a greeting */ // Line 3
public static void main(String[] args) // Line 4
&...
b. DebugOne2.java
Explanation of Solution
Errors in the given program:
In the given program “DebugOne2.java”, there are two errors, they are,
- The print statements are given wrongly; the correct statement to print is “System.out.println”.
- The double quotes in print statement are missing in Line 8 and Line 10.
Corrected Program:
// Class definition
public class FixDebugOne2 // Line 1
{ // Line 2
/* This program displays some output*/ // Line 3
public static void main(String[] args) // Line 4
{ // Line 5
// Display the statement
System.out...
c. DebugOne3.java
Explanation of Solution
Errors in the given program:
In the given program “DebugOne3.java”, there are two errors, they are,
- The main method is not defined properly, the square brackets “[]” is missing in String function.
- The print statements are given wrongly;
- In Line 6, the letter “l” should be typed instead of “1”.
- In Line 7, the letter “i” should be typed instead of “1”.
- In Line 8, the letter “S” should be in uppercase instead of lowercase “s”.
Corrected Program:
// Class definition
public class FixDebugOne3 // Line 1
{ // Line 2
/* This program displays some output*/ // Line 3
public static void main(String[] args) // Line 4
{ ...
d. DebugOne4.java
Explanation of Solution
Errors in the given program:
In the given program “DebugOne4.java”, there are few errors, they are,
- In the main method in Line 3, the “static” keyword is misspelled.
- In Line 4, the “JOptionpane” class is misspelled, it should be “JOptionPane”.
- In Line 4, the parameter “nul” in “JOptionPane” class is misspelled, it should be “null”.
Corrected Program:
// Import the package
import javax.swing...
Trending nowThis is a popular solution!
Chapter 1 Solutions
Java Programming, Loose-leaf Version
- Each of the following files in the Chapter.10 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugTen01.cs will become FixedDebugTen01 .cs. a. DebugTen01.cs b. DebugTen02.cs c. DebugTen03.cs d. DebugTen04.csarrow_forwardEach of the following files in the Chapter.04 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem, and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, save DebugFour1.cs as FixedDebugFour1.cs. a. DebugFour1.cs b. DebugFour2.cs c. DebugFour3.cs d. DebugFour4.csarrow_forwardEach of the following files in the Chapter.01 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugOne1.cs will become FixedDebugOne1 .cs. a. DebugOne1.cs b. DebugOne2.cs c. DebugOne3.cs d. DebugOne4.csarrow_forward
- Each of the following files in the Chapter.07 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem, and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugSeven1.cs will become FixedDebugSeven1.cs. a. DebugSeven1.cs b. DebugSeven2.cs c. DebugSeven3.cs d. DebugSeven4.csarrow_forwardEach of the following files in the Chapter.05 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem, and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, save DebugFive1.cs as FixedDebugFive1 .cs. a. DebugFive1.cs b. DebugFive2.cs c. DebugFive3.cs d. DebugFive4.csarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT