From 082ac1fab3144f1c7b1789d431ec7b88d0bc8f1a Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 25 Feb 2025 13:31:54 -0800 Subject: [PATCH] Add Q3.java --- Q3.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Q3.java diff --git a/Q3.java b/Q3.java new file mode 100644 index 0000000..8934728 --- /dev/null +++ b/Q3.java @@ -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"); + } +} \ No newline at end of file