Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is the question and below it is the file that will be modified according to the question. Please solve it clearly so that I

Here is the question and below it is the file that will be modified according to the question. Please solve it clearly so that I can apply the same steps and get the result

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
You will create a password verification program using character testing. Start with the program CustomerNumber.java( The file is at the end of this file under the question, and I put a yellow highlight on the file that you will work on) Naming: . Name the Java project: LastFProjectAssign07 . Name the driver program (main): LastFAssign07.java . Where Last is your last name and F is the first initial of your first name. Ex: AladmyR . Save in a file folder on your storage device. Instructions: The user will enter a password as a String. You must test that the password contains at least: . The password should be at least 8 characters long. . One lowercase letter . One uppercase letter . One number (0-9} . Must contain a $. . The password can contain no spaces Hint: you will need a loop and one or more boolean flags. Tell the user what they entered incorrectly. Your output does not need to be exactly like mine. Sample output 1: Enter a password: Invalid Length. Password must contain at least one upper, one lower, and one digit. That is not the proper format. Sample output 2: Enter a password: Password may not contain spaces. That is not the proper format. Sample output 3: Enter a password: Password must contain a \"\".$ That is not the proper format. SampleoutDUt 4; Enter a password: That's a valid password. Test the program and make sure it runs. I want to see comments and descriptive variable names throughout your program!!!! Upload the file: LastFAssignO7.java CustomerNumber.java importjava.uti|.Scanner; /** * This program tests a customer number to determine * whether it is in the proper format. */ public class CustomerNumber { public static void mainlString args) { String customer; // To hold a customer number // Create a Scanner object for keyboard input. Scanner keyboard = new Scanner(System.in); System.out.print|n("Enter a customer number in " + "the form LLLNNNN"); System.out.print("(LLL = letters and NNNN " + "= numbers): "); // Get a customer number from the user. customer = keyboard.nextLine(); // Determine whether it is valid. if (isValid(customer)) System. out.printIn("That's a valid customer " + "number."); else System.out. printIn("That is not the proper " + 'format."); System.out.printIn("Here is an example: " + "ABC1234"); * * * The isValid method accepts a String as its argument * and tests its contents for a valid customer number. */ private static boolean isValid(String custNumber) boolean goodSoFar = true; // Flag int index = 0; // Loop control variable // Is the string the correct length? if (custNumber.length() != 7) goodSoFar = false; // Test the first three characters for letters. while (goodSoFar && index

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions