From 56920e7c283c044c97bcfdc1c448654247c3a3b3 Mon Sep 17 00:00:00 2001 From: Johncarlo Perez Date: Wed, 9 Apr 2025 11:09:30 -0700 Subject: [PATCH 1/2] hardcoded password and printed it --- src/PasswordApp.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PasswordApp.java b/src/PasswordApp.java index 86fb0b1..e50cce6 100644 --- a/src/PasswordApp.java +++ b/src/PasswordApp.java @@ -1,5 +1,9 @@ public class PasswordApp { - public static void main(String[] args) { + public static void main(String[] args) { System.out.println("Welcome to the password checker!"); + + String password = "hello123"; + + System.out.println("The password is: " + password); } } \ No newline at end of file From 3bffeb4a7ed100889d9a8ed046d852d79555d7af Mon Sep 17 00:00:00 2001 From: Johncarlo Perez Date: Wed, 9 Apr 2025 11:23:53 -0700 Subject: [PATCH 2/2] user input for password --- src/PasswordApp.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/PasswordApp.java b/src/PasswordApp.java index e50cce6..4d522d4 100644 --- a/src/PasswordApp.java +++ b/src/PasswordApp.java @@ -1,9 +1,18 @@ +import java.util.Scanner; + public class PasswordApp { public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); System.out.println("Welcome to the password checker!"); - String password = "hello123"; + String password = scanner.nextLine(); System.out.println("The password is: " + password); - } -} \ No newline at end of file + + if(password.length() >= 12 ) { + System.out.println("Your password is a good length! "); + } else { + System.out.println("Your password is to short"); + } + } + } \ No newline at end of file