How to write a program using SWITCH that accepts input from the user and that input can be used to compute the users age?
This is my code: import java.util.Scanner; public class OctoberAge { public static void main(String[] args) { // Accept input from the user and that input can beused to compute the users age. // if the age is less than 10 months old, you're an infant. // 10 months - 2 years old = you're a baby // 3 - 15 years old = you're a kid // 16 - 18 years old = you're a teenager // 19 - 99 years old = you're an adult // 100 - 100+ years old = you're dead Scanner sc = new Scanner(System.in); int UserYear; int UserMonth; int a; System.out.println("Please input your year of birth: ") System.out.print("Year: ") UserYear = sc.nextInt(); a = (2018 - UserYear); System.out.println("Your age is" + a); switch(a) { case 1: System.out.println("you're a baby") break; case 2: System.out.println("you're a kid") break; case 3: System.out.println("you're a teenager") break; case 4: System.out.println("you're an adult") break; case 5: System.out.println("you're dead") break;