Add Q3.java

This commit is contained in:
2025-02-25 13:31:54 -08:00
parent 730b4086e5
commit 082ac1fab3

44
Q3.java Normal file
View File

@@ -0,0 +1,44 @@
// Question 1
// Import Scanner for user input
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Scanner for user input
Scanner scanner = new Scanner(System.in);
// Store the yes/no's
String response;
// First step
System.out.println("Reboot the computer and try to connect.");
System.out.println("Did that fix the problem?");
response = scanner.nextLine().toLowerCase();
// If yes then exit the program
if(response.equals("yes"))
return;
System.out.println("Reboot the router and try to connect.");
System.out.println("Did that fix the problem?");
response = scanner.nextLine().toLowerCase();
// If yes then exit the program
if(response.equals("yes"))
return;
System.out.println("Make sure the cables between the router & modem are plugged in firmly");
System.out.println("Did that fix the problem?");
response = scanner.nextLine().toLowerCase();
// If yes then exit the program
if(response.equals("yes"))
return;
System.out.println("Move the router to a new location");
System.out.println("Did that fix the problem?");
response = scanner.nextLine().toLowerCase();
// If yes then exit the program
if(response.equals("yes"))
return;
// Done
System.out.println("Get a new router");
}
}