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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started