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_2

Step: 3

blur-text-image_3

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

love of humour, often as a device to lighten the occasion;

Answered: 1 week ago

Question

orderliness, patience and seeing a task through;

Answered: 1 week ago

Question

well defined status and roles (class distinctions);

Answered: 1 week ago