Answered step by step
Verified Expert Solution
Link Copied!

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

What attracts you about this role?

Answered: 1 week ago

Question

How many states in India?

Answered: 1 week ago

Question

HOW IS MARKETING CHANGING WITH ARTIFITIAL INTELIGENCE

Answered: 1 week ago