In this program, we will further develop homework3_5, which determine whether the password meets all the requirements or not. In this program, you will keep asking the user to enter a password until it meets all the requirements In order to do that, you need to (1) create a class called homework4_5 (2) ask the user to enter a password (3) if the password meets all the requirement, display "Your account has been created successfully"; otherwise, display the error message "Your password does not meet the requirement, please try again", then give the user another chance to enter a password (4) here is the requirements that password should meet - the total length is at least 8 - you need to have at least 1 uppercase letter - you need to have at least 1 lowercase letter. Here are examples: Example 1: input: abcdABCD1234 output: Your account has been created successfully Example 2: input: abcdABC output: Your password does not meet the requirement. Please enter a password input: abcdefggert output: Your password does not meet the requirement. Please enter password input: ABCDEFGHWERGH output: Your password does not meet the requirement. Please enter a password input: ABcwergfhuw output: Your account has been created successfully

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question
100%

please answer with proper explanation. i will give u upvote.

(JAVA) This is what I have so far. Not sure where to go from here. Thanks for your help!

import java.util.Scanner;
import java.lang.String;
import java.lang. Character;
public class homework4_5
{
}
public static void main(String[] args);
{
}
}
Scanner input = new Scanner(System.in);
System.out.println("Please enter a password.");
String s = input.next();
if (is_Valid Password(s)) {
}
System.out.println("Your
System.out.println("Your
} else {
}
account has been created successfully");
password does not meet the requirement. Please enter a password");
public static boolean is_Valid_Password (String password);
if (password. length() >= 8) return true;
int charCount = 0;
int numCount = 0;
for (int i = 0; i < password. length(); i++) {
char ch password.charAt(i);
if (is_Numeric (ch)) numCount++;
else if (is_Letter (ch)) charCount++;
else return false;
}
return (charCount >= 2 && numCount >= 2);
public static boolean is_Letter (char ch) {
ch= Character.toUpperCase(ch);
return (ch >= 'A' && ch <= 'Z');
}
public static boolean is_Numeric (char ch) {
return (ch >= '0' && ch <= '9');
Transcribed Image Text:import java.util.Scanner; import java.lang.String; import java.lang. Character; public class homework4_5 { } public static void main(String[] args); { } } Scanner input = new Scanner(System.in); System.out.println("Please enter a password."); String s = input.next(); if (is_Valid Password(s)) { } System.out.println("Your System.out.println("Your } else { } account has been created successfully"); password does not meet the requirement. Please enter a password"); public static boolean is_Valid_Password (String password); if (password. length() >= 8) return true; int charCount = 0; int numCount = 0; for (int i = 0; i < password. length(); i++) { char ch password.charAt(i); if (is_Numeric (ch)) numCount++; else if (is_Letter (ch)) charCount++; else return false; } return (charCount >= 2 && numCount >= 2); public static boolean is_Letter (char ch) { ch= Character.toUpperCase(ch); return (ch >= 'A' && ch <= 'Z'); } public static boolean is_Numeric (char ch) { return (ch >= '0' && ch <= '9');
/*
In this program, we will further develop homework3_5, which determine whether the password meets
all the requirements or not.
In this program, you will keep asking the user to enter a password until it meets all the requirements
In order to do that, you need to
(1) create a class called homework4_5
(2) ask the user to enter a password
(3) if the password meets all the requirement, display "Your account has been created successfully";
otherwise, display the error message "Your password does not meet the requirement, please try
again", then give the user another chance to enter a password
(4) here is the requirements that password should meet
- the total length is at least 8
- you need to have at least 1 uppercase letter
- you need to have at least 1 lowercase letter
Here are examples:
Example 1:
input: abcdABCD1234
output: Your account has been created successfully
Example 2:
*/
input: abcdABC
output: Your password does not meet the requirement. Please enter a password
input: abcdefggert
output: Your password does not meet the requirement. Please enter a password
input: ABCDEFGHWERGH
output: Your password does not meet the requirement. Please enter a password
input: ABcwergfhuw
output: Your account has been created successfully
Transcribed Image Text:/* In this program, we will further develop homework3_5, which determine whether the password meets all the requirements or not. In this program, you will keep asking the user to enter a password until it meets all the requirements In order to do that, you need to (1) create a class called homework4_5 (2) ask the user to enter a password (3) if the password meets all the requirement, display "Your account has been created successfully"; otherwise, display the error message "Your password does not meet the requirement, please try again", then give the user another chance to enter a password (4) here is the requirements that password should meet - the total length is at least 8 - you need to have at least 1 uppercase letter - you need to have at least 1 lowercase letter Here are examples: Example 1: input: abcdABCD1234 output: Your account has been created successfully Example 2: */ input: abcdABC output: Your password does not meet the requirement. Please enter a password input: abcdefggert output: Your password does not meet the requirement. Please enter a password input: ABCDEFGHWERGH output: Your password does not meet the requirement. Please enter a password input: ABcwergfhuw output: Your account has been created successfully
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT