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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education