Write a program VotingAge.java
that asks the user to enter their age, and then prints out a message that’s appropriate for them.
If the user is old enough to vote (18 years old), the program should display a couple of lines letting the know that they can vote, and that they should vote!
If the user is not old enough to vote, calculate how many years they have until they can vote and print out how long they’ll have to wait.
As part of this assignment, write a boolean method isVotingAge(double age)
that takes a person’s age as a parameter and returns true
if they are old enough to vote, otherwise false
. Call this method from within the main()
program.