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 (MindTap Course List)
- 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_forwardStarting Out with Java From Control Structures through Objects 6th Editionarrow_forward
- JavaProblem 2-5 Code ProblemProblem 2-5. Code Problem. Build an application with a text field and two buttons. Type a word or words in the text field. Click one of the buttons. Subtract one from the Unicode value for each character in the typed word(s), then redisplay it. This is a simple encoding technique. When you click the other button, reverse the process to decode the word.arrow_forwardMake use of C# in Visual Studio. The below form will represent the main form from which the user will navigate to the other forms. Meaning each button should be linked to the appropriate form. E.g. If button Manage Addresses is clicked the form managed addresses should be displayed. The Exit button should successfully terminate the program. Create a void method for each button and name them as follow: LinkToAddresses (), LinkToCustomers (), LinkToDrivers (), LinkToStatus (), and LinkToFreight (). The methods should be called under the appropriate button. For the exit button create a void method named AppExit () this should terminate the program.arrow_forwardMake use of C# in Visual Studio. The below form will represent the main form from which the user will navigate to the other forms. Meaning each button should be linked to the appropriate form. E.g. If button Manage Addresses is clicked the form managed addresses should be displayed. The Exit button should successfully terminate the program. Create a void method for each button and name them as follow: LinkToAddresses (), LinkToCustomers (), LinkToDrivers (), LinkToStatus (), and LinkToFreight (). The methods should be called under the appropriate button. For the exit button create a void method named AppExit () this should terminate the program.arrow_forward
- Please code in javas, thank you Write a program that opens the salesdat.txt file and processes it contents. The program should display the following per store:The total sales for each week. (Should print 5 values - one for each week).The average daily sales for each week. (Should print 5 values - one for each week).The total sales for all the weeks. (Should print 1 value)The average weekly sales. (Should print 1 value)The week with the highest amount in sales. (Should print 1 week #)The week with the lowest amount in sales. (Should print 1 week #)All Values (Total Sales, Average Daily Sales for Each Week, Total Sales for all Weeks, Average Weekly Sales, Highest Amount in Sales, Lowest Amount in Sales) The file contains the dollars amount of sales that a retail store made each day for a number of weeks. Each line in the file contains thirty five numbers, which are sales numbers for five weeks. The number are separated by space. Each line in the file represents a separate store. Please…arrow_forwardJava Programming: Below is the lexer, shank and token files along with the shank.txt file. The shank file is the main method file. The lexer must break up the input text stream into lexemes and return a token object for each one in the shank.txt file. Make sure to fix the errors in the lexer.java file and show the complete code for lexer.java.There must be no error in the code at all. Run the whole code and show the output which the shank.txt must be printed out in the terminal. Attached is the rubric. Lexer.java package mypack; import java.util.HashMap;import java.util.List;import mypack.Token.TokenType; public class Lexer { private static final int INTEGER_STATE = 1;private static final int DECIMAL_STATE = 2;private static final int IDENTIFIER_STATE = 3;private static final int SYMBOL_STATE = 4;private static final int ERROR_STATE = 5;private static final int STRING_STATE = 6;private static final int CHAR_STATE = 7;private static final int COMMENT_STATE = 8; private static final…arrow_forwardFile ApplicationCentre.java, which contains classes ApplicationCentre and Student. Introduction Write a Java program to handle applications for universities admission providing a good user interface. This program should work as a Frame with the width = 500 pixels and the height = 500 pixels. The tasks of this Java program: - to enter information for a number of students - to display in a separate window the information about all the students stored - to display in another separate window the information for a selected student Your Task In this assignment class Student encapsulates the student information relevant for universities admission: student name (just the family name), high school average and 3 universities chosen. The admission is based on the high school average according to the following table: University High school average for admission Toronto 90 York 84 Brock 75 Guelph 76 Waterloo 88 McGill 90 Concordia 76 Laval 78 Macmaster 82 Western 80 Based on this table a method of…arrow_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