Question: Assume a variable voterAge that has already been declared and initialized with a value, write ONE if / else if / else block to validate

Assume a variable voterAge that has already been declared and initialized with a value, write ONE if/else if/else block to validate voterAge as follows:
if voterAge is greater than or equal to 18, output the message "You are eligible to vote"
if voterAge is between 0 and 17, output the message "You are NOT eligible to vote"
if voterAge is less than 0, output the message "Age entered is INVALID!"
Edit Format Table
12ptvv Paragraph
Assume a variable voterAge that has already been

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!