subject

Create a class and call it VotingValidator. java that does the following: - Ask the user to enter their DoB in the format MM/DD/ - The class has a method named ValidateAge which accepts the user input and throws a custom exception named InvalidAgeException. - ValidateAge method doesn’t return anything, and it checks if the user is 21 years old by Election day (November 3rd , 2020) or not. o If the user is 21 or older by 2020, the class prints a message "Welcome to Vote!" o Otherwise, your method will throw InvalidAgeException which is the custom exception you will create. This exception will print the following message in the console when thrown "Error: User can not vote this election because user’s DoB is and he/she will be by election day. " - ValidateAge method is called from the main method and is wrapped by a try/catch to handle the exception.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Ais a built in formula in spread spread a is any math process such as addition or subtraction. options are function and operation
Answers: 1
You know the right answer?
Create a class and call it VotingValidator. java that does the following: - Ask the user to enter th...
Questions
question
Mathematics, 04.12.2020 18:30
question
Mathematics, 04.12.2020 18:30
question
English, 04.12.2020 18:30
Questions on the website: 13722360