marina Gregory

Greenhorn
+ Follow
since Nov 03, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by marina Gregory

Hello there.thank you for the help.meant a lot that you were there to help out. finally figured out the problem...Boolean operators,that is what was giving me trouble...the difference between AND and single version AND or OR and single version OR...



hehe...and no i didn't really understand some parts of the code you showed like "new PasswordValidator(inScan.nextLine()).showValidation();" or why you used a private Demo class or why private final String password was used or why "this" was used...i'm really sorry..i'm kinda new to java ....but thank you for the help...will learn to divide and conquer...do you know any good references for me to look into or extra practice problems that i can look at?
8 years ago
no,its not for a real website... the same way i typed the code...i am really confused... whats wrong with the code...i doubt i am even getting the logic behind loops
8 years ago
Should the user get the password incorrect three times in a row then inform the user of the current password and allow the user to set a new password. Check the new password so that it satisfies these modified java identifier rules:
1. The password may have any number of characters between 1 and 20, inclusive.
2. The password may start with an underscore “_” or any letter of the alphabet
3. The password may be any combination of upper and lower case letters.
4. The password consists only of numbers, English alphabet letters, and the underscore character.

sorry ,the end of the do while should be "while(!inputPass.equals(passWord) && count<2); "...not count<=2.
If i enter the correct password "Test" ...it outputs fine, but if the password is incorrect i get 2 more attempts
it then prompts the user to enter a new password , if the new password satisfies the rules given "valid password" is given the output
8 years ago
Thanks for the welcome and the reply:)
oh...i never knew that it was error prone,thanks for the advice and making it easier to read.
I have been fiddling with this code for a long time now...like its been 5 days now since i am stuck with this looping business.
well, the valid was what i thought , to make it easier for me to give a true or false result...but yeah...it is kinda useless and i thought of just trying it out.
This is something else i did,got the method or saw i could try and do it from someone who posted a question which was kind of similar but not the same in Big Moose Saloon ...using the call by method i guess...
It runs but im not getting the required output...
incorrect password . Please set a correct password
incorrect password . Please set a correct password
incorrect password . Please set a correct password
incorrect password . Please set a correct password
The password was Test.Please enter a correct new password

and does not print out" valid password"

please help

8 years ago


the code runs but it doesn't exactly read the new password and output comes as:

incorrect password . Please set a correct password
incorrect password . Please set a correct password
incorrect password . Please set a correct password
The password was Test.Please enter a correct new password
password starts with underscore or any case alphabet.//----------->this is the part that is bugging me

i'm kinda new to programming ...please help
i'm supposed to:
Imagine that the password to sign in to some computer is “John”. Write a program that prompts the user to enter a password to login to this imaginary computer. If the user enters the correct password then notify the user and terminate the program. Should the user get the password incorrect three times in a row then inform the user of the current password and allow the user to set a new password. Check the new password so that it satisfies these modified java identifier rules:
1. The password may have any number of characters between 1 and 20, inclusive.
2. The password may start with an underscore “_” or any letter of the alphabet
3. The password may be any combination of upper and lower case letters.
4. The password consists only of numbers, English alphabet letters, and the underscore character.
8 years ago