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. An example of the program is shown below: Enter three names. They can be the same or different. First name >> Caden Second name >> Kaden Third name >> Cayden Caden and Kaden are different Caden and Cayden are different Kaden and Cayden are different Tasks III The DebugSeven1 class compiles without error. > The DebugSeven1 program compares three String values and indicates if any are identical. > DebugSeven1.java X + 1 // Makes String comparisons 2 import java.util.*; 3 public class DebugSeven1 4 { 5 6 7 8 9 10 11 12 13 14 15 16 69 17 18. 19 20 21 22 23 24 25 26 27 28 29 } 30 public static void main(String[] args) { Scanner kb = new Scanner(System.in); String name1, name2, name3; } System.out.println("Enter three names."); System.out.println("They can be the same or different."); System.out.print("First name >> "); name1= kb.nextLine; System.out.print("Second name >> "); name2 kb.nextLine; System.out.print("Third name >> "); name3= kb.nextLine; compareNames (namel, name2); compareNames (namel, name3); compareNames (name2, name 3); } public static void comparNames (String n1, n2) { System.out.print(n1+" and " + n2); if(nl.equals(n2) System.out.println(" are the same"); System.out.println(" are different"); else

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 2PP: (Data processing) a. Store the following data in a file, or use the numbers.dat file provided on...
icon
Related questions
Question
Unit 7: Debugging Exercise 7-1
m
Instructions
=
bl
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.
An example of the program is shown below:
Enter three names.
They can be the same or different.
First name >> Caden
Second name >> Kaden
Third name >> Cayden
Caden and Kaden are different
Caden and Cayden are different
Kaden and Cayden are different
Tasks
The DebugSeven1 class compiles without error. >
The DebugSeven1 program compares three
String values and indicates if any are identical.
>
DebugSeven1.java X +
1 // Makes String comparisons
2 import java.util.*;
3 public class DebugSeven1
4 {
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 }
30
public static void main(String[] args)
{
Scanner kb = new Scanner(System.in);
String namel, name2, name3;
}
System.out.println("Enter three names.");
System.out.println("They can be the same or different.");
System.out.print("First name >> ");
name1= kb.nextLine;
System.out.print("Second name >> ");
name2= kb.nextLine;
System.out.print("Third name >> ");
name3= kb.nextLine;
compareNames (namel, name2);
compareNames (namel, name3);
compareNames (name2, name3);
}
public static void comparNames (String n1, n2)
{
System.out.print(n1 + " and " + n2);
if(nl.equals(n2)
System.out.println(" are the same");
System.out.println(" are different");
else
Transcribed Image Text:Unit 7: Debugging Exercise 7-1 m Instructions = bl 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. An example of the program is shown below: Enter three names. They can be the same or different. First name >> Caden Second name >> Kaden Third name >> Cayden Caden and Kaden are different Caden and Cayden are different Kaden and Cayden are different Tasks The DebugSeven1 class compiles without error. > The DebugSeven1 program compares three String values and indicates if any are identical. > DebugSeven1.java X + 1 // Makes String comparisons 2 import java.util.*; 3 public class DebugSeven1 4 { 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 } 30 public static void main(String[] args) { Scanner kb = new Scanner(System.in); String namel, name2, name3; } System.out.println("Enter three names."); System.out.println("They can be the same or different."); System.out.print("First name >> "); name1= kb.nextLine; System.out.print("Second name >> "); name2= kb.nextLine; System.out.print("Third name >> "); name3= kb.nextLine; compareNames (namel, name2); compareNames (namel, name3); compareNames (name2, name3); } public static void comparNames (String n1, n2) { System.out.print(n1 + " and " + n2); if(nl.equals(n2) System.out.println(" are the same"); System.out.println(" are different"); else
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning