Question: JAVA (20 points) Complete the body of main so it prompts the user for a password candidate until either the password candidate is the empty

JAVA

(20 points) Complete the body of main so it prompts the user for a password candidate until either the password candidate is the empty string, or the password candidate is acceptable according to isOK. (In our formal specifications, for a mathematical string such as pwd, |pwd| means the length of pwd.)

/** * Checks whether the given string satisfies the criteria for * an acceptable password. *

* @param pwd * the string to check for acceptability

* @requires * |pwd| > 0 * @ensures * isOK = [pwd satisfies the criteria for an acceptable password]

*/ private static boolean isOK(String pwd)

{...}

/** * Main method. * * @param args * the command line arguments */

public static void main(String[] args)

{

SimpleReader in = new SimpleReader1L();

SimpleWriter out = new SimpleWriter1L();

in.close();

out.close();

}

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!