Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Finish writing Lab4.java below: Before you begin, DOWNLOAD the file Lab5.java from Canvas to your network drive (not the local hard drive or desktop). Once
Finish writing Lab4.java below:
Before you begin, DOWNLOAD the file Lab5.java from Canvas to your network drive (not the local hard drive or desktop). Once you have the file saved, open the file. From scratch, create a program to... -Display the parameters of a valid password - minimum of 8 characters that includes at least one digit and at least one of the following special characters. ! @ # $ * (DONE) -Ask the user for a password then make sure it is valid, following the parameters listed above -If the password is invalid, display one of the following error messages and loop until password is valid Invalid password - must be at least 8 characters Invalid password - must contain at least one digit Invalid password-must contain at least one of the following characters. ! @ # $ * (If more than one of these conditions are true, say less than 8 characters and no digit, you only need to display one of the appropriate error messages) -Once password is valid, confirm the password by having the user retype the password and comparing it to the originally entered password. If invalid, display an error message and loop until they type in the matching password. (For this lab, you do not need to allow them to re-enter a new password.) -Once passwords match, using StringBuilder, write the password to a text file called Lab5.txt, but use the following simple encryption write the ASCII value for each character, delimited by a comma. Write a 0 (zero) to indicate the end of the password. Hint: To convert a char to its ASC equivalent: int asciiVal = (int) ch; Before you begin, DOWNLOAD the file Lab5.java from Canvas to your network drive (not the local hard drive or desktop). Once you have the file saved, open the file. From scratch, create a program to... -Display the parameters of a valid password - minimum of 8 characters that includes at least one digit and at least one of the following special characters. ! @ # $ * (DONE) -Ask the user for a password then make sure it is valid, following the parameters listed above -If the password is invalid, display one of the following error messages and loop until password is valid Invalid password - must be at least 8 characters Invalid password - must contain at least one digit Invalid password-must contain at least one of the following characters. ! @ # $ * (If more than one of these conditions are true, say less than 8 characters and no digit, you only need to display one of the appropriate error messages) -Once password is valid, confirm the password by having the user retype the password and comparing it to the originally entered password. If invalid, display an error message and loop until they type in the matching password. (For this lab, you do not need to allow them to re-enter a new password.) -Once passwords match, using StringBuilder, write the password to a text file called Lab5.txt, but use the following simple encryption write the ASCII value for each character, delimited by a comma. Write a 0 (zero) to indicate the end of the password. Hint: To convert a char to its ASC equivalent: int asciiVal = (int) chStep 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