Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

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');
expand button
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
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education