5.1 It is vital to restrict access to certain programs. Write a complete Java program called Verify that accepts as input username and password. The following input is used to test the program: username = "Micky" password = "R@in2" Output relevant messages for correct and incorrect input. 5.2 Write a complete Java program called Vote that accepts as input the users' age. Should the user be older than or equal to 18 years and less than equal to 117 years, the program should output the following message "You are eligible to vote!" Should the user be less than 18 and greater than equal to 1, the program should display the following message "You are not old enough to vote". Include relevant statements to check for invalid input.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question
Question 5
5.1 It is vital to restrict access to certain programs. Write a complete Java program called Verify
that accepts as input username and password. The following input is used to test the program:
username = "Micky"
password = "R@in2"
Output relevant messages for correct and incorrect input.
5.2 Write a complete Java program called Vote that accepts as input the users' age. Should the
user be older than or equal to 18 years and less than equal to 117 years, the program should
output the following message "You are eligible to vote!"
Should the user be less than 18 and greater than equal to 1, the program should display the
following message "You are not old enough to vote". Include relevant statements to check for
invalid input.
Transcribed Image Text:Question 5 5.1 It is vital to restrict access to certain programs. Write a complete Java program called Verify that accepts as input username and password. The following input is used to test the program: username = "Micky" password = "R@in2" Output relevant messages for correct and incorrect input. 5.2 Write a complete Java program called Vote that accepts as input the users' age. Should the user be older than or equal to 18 years and less than equal to 117 years, the program should output the following message "You are eligible to vote!" Should the user be less than 18 and greater than equal to 1, the program should display the following message "You are not old enough to vote". Include relevant statements to check for invalid input.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT