Question: (6 pts) Problem 3 Within your Lab4 folder, write a program named Passvordchecker. java that asks the user to enter a password. The program should
(6 pts) Problem 3 Within your Lab4 folder, write a program named Passvordchecker. java that asks the user to enter a password. The program should show an access granted or denied message depending on whethe password was correct (the correct password can be anything you want). Use a loop to allow the user a maximum of 5 incorrect entries before ending the program. For each incorrect entry, the program shoud also display how many attempts are remaining. for equality of the- relational operator. To check whether two Remember that as discussed in class and in Section 3.12 of the zyBook, comparing strings should be done using the .equals method instead of therelational operator. To strings s1.equals (s2). To check whether s are not equal, use the boolean expression s1.equals (s2). s1 and s2 are equal, use the boolean expression Here are two examples of what your completed program might look like when you run it. Underlined parts indicate what you type in as the program is running. (In these examples, the correct password is sloth.) nter password: dog ter password: cat er passvord: bear password: sloth acorrect password. You have 4 attempts remaining before system lockout. correct passvord. You have 3 attempts remaining before system lockout. rrect passvord. You have 2 attempts remaining before system lockout. s granted, welcome. 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
