Question: Write a program that prompts the user to enter his age. Write the statements needed to display the following messages based on the entered value:
Write a program that prompts the user to enter his age. Write the statements needed to display the following messages based on the entered value: "User is 18 or younger" "User age is between 19 and 39" "User is either 45 OR 50" "User is older than 50" import java.util.*; public class practical {public static void main (String args[]) { Scanner scan = new Scanner(System.in); } { |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
