Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your task for this lab is to write and test a subclass of User called SecureUser. This subclass should override the authenticate method to meet
Your task for this lab is to write and test a subclass of User called SecureUser. This subclass should override
the authenticate method to meet more stringent requirements. In particular, a SecureUser class should
"lock" a user out after three consecutive failed authentications. In other words, the authentication method
should return true only if the string passed into the method matches the password AND there have not been
three consecutive failed authentications. If the user has two failed authentications and then a successful
authentication, you should reset the number of consecutive failed authentications to zero. You should also
add code to Main.java so that it thoroughly tests the SecureUser class. It is up to you how many tests you
want to create.
You should not make any changes to User.java, and you should only add to Main.java. Do not change any
code that is already present.
Hint: You will probably find it useful to add a new field to the SecureUser class to keep track of the number
of consecutive failed authentications.
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