Question: What should I put at the comment? Also i have two errors at the two strings near the end. import java.util.Scanner; import java.io.*; class Main
What should I put at the comment? Also i have two errors at the two strings near the end.
import java.util.Scanner;
import java.io.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Name game");
String name = "";
while (!name.equals("quit")) {
System.out.println(" What is your name?");
String name = sc.nextLine();
name = checkName(name);
if (name.equals("Jack"));
break;
}
private static void String checkName(String name) {
// update the value of name
return name;
}
}
}
check name requirement
All code that is dependent on what the user specifies their name as is moved to a separate method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
