Question: 4. (8 points) Write a class called VoteAge, which does the following: Ask the user to enter their age (ex. XX) Get the age
4. (8 points) Write a class called VoteAge, which does the following: Ask the user to enter their age (ex. XX) Get the age using a Scanner Tips If the age is greater than or equal to 18, it prints: "You are XX years old, old enough to vote." Otherwise, it prints: "You are XX years old, not old enough to vote." Use an if-else statement Submission Copy&Paste your source code. Screen shot the console with user input of 2 Screen shot the console with user input of 18 Sample Run Enter your age in years: 2 You are 2 years old, not old enough to vote. Enter your age in years: 18 You are 18 years old, old enough to vote.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
