Question: Wrte a method thet loops forever until the user inpuis the cormect secret password or until the user fails to enter the cormect password 10

 Wrte a method thet loops forever until the user inpuis the

Wrte a method thet loops forever until the user inpuis the cormect secret password or until the user fails to enter the cormect password 10 times. The secret password the prograrm should look for is the String secret" public void secretPasswo rdO public void secretPasswo rdo) int count- while(true) int count 0; whi le(true) Use readl ine(String prompt) for user input if(count t10) if(count 10) ublic void secretPasswo public void secretPasswo System,out.p rinttn("You are locked o rdO System.out.p int count-e; while(true) rintin"You are locked o ut!"); ut!i return; int count 1; whileCtrue) if(count10) ifCtreadLineC"Pa snord?).equals("secret" sswond?").equatsC"secre System, out.p if Ccount 18) i fCreadLine("Pas System.out.p System.out.p intlnC"You ore locked t!) rintin("You are locked return System.out.P rintIn("Welcomeli return; rintin"Welcome!); return ifCreadLineC"Pas if(readline( Pas 0rd?").equat sC'secret")) siord?").equals("secret.): count++ ; count++: System,out.p System.out.p -intin("Welcome!) rintinC"Welcome! return return; count++ count++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!