Question
Write a simple program to create five security questions for users to answer. program should use at least three different primitive types (String is also
Write a simple program to create five security questions for users to answer.
program should use at least three different primitive types (String is also allowed) to store answers of those questions. Store your own five answers as constants (e.g., default answers) in the program, and prompt the user for their five answers in your program.
Ensure that your program includes basic validation actions for user inputs (e.g., age cannot be a negative number, name cannot be empty) and rejects invalid values (e.g., print out a message to tell user what is wrong, and terminate the program: e.g., use System.exit() method).
Once the user has entered their values, print both your answers and theirs.
If any of your personal answers are the same as the user, print a special message for each similar answer to alert the user to this fact. (Note: The information that you provide to compare to the user's does not have to be real or accurate, feel free to make up values as long as they make sense within the context of your program.)
Code is in Java Language
What is your favorite album? Enter title: Wish You Were Here What is your favorite artist? Enter Artist: Pink Floyd What is the year of your favorite album released? Enter Year: 1975 What is the rating of your favorite album? Enter Rating: 4.3 What is the unites of your favorite album sold? Enter Units Sold: 20000000 Your favorite album is Wish You Were Here, favorite artist is Pink Floyd, year released: 1975, rating: 4.3, and units sold: 20000000 My favorite album is The Dark Side of the Moon, favorite artist is Pink Floyd, year leased: 1973, rating: 4.2, and units sold: 45000000 Both of our favorite artist is Pink Floyd!
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