Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started