Consider the following program: import java.util.Scanner; public class Colours3 { public static void main(String[] args) { int x; Scanner keyboard = new Scanner(System.in); System.out.print("Enter a...

Consider the following program: import java.util.Scanner; public class Colours3 { public static void main(String[] args) { int x; Scanner keyboard = new Scanner(System.in); System.out.print("Enter a number: "); x = keyboard.nextInt(); switch (x) { case 1: case 2: System.out.println("Green"); break; case 3: case 4: case 5: System.out.println("Blue"); break; default: System.out.println("numbers 1-5 only"); } System.out.println("Red"); } } What would be the output from this program if (a) the user entered 1 when prompted? (b) the user entered 2 when prompted? (c) the user entered 3 when prompted? (d) the user entered 10 when prompted? (e) the break statements were removed from the switch statement and the user entered 3 when prompted? (f) the default were removed from the switch statement and the user entered 10 when prompted?
Nov 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here