HI All,
I am the new member of this group, i want code for the following
requirements.
it's urgent to me. Please send the code.
Write a code for the password checking.
specifications are as follows:
Read the password from keyboard.
1. password length should be 4-12 characters.
2. The first character should be alphabet.
3. Patterns should not repeat in the given password(Eg. if the given
password is 'cucumber' this should not be accepted because, pattern
'cu' repeated.) that pattern contains any no. of characters( 2 or
more.)
eg. if the given password is like 'cu2cumber'. then it is accepted.
because in between two 'cu' patterns there is '2' so it is acceptable.
4. If the password is accepted shpuld print the msg as "accepted"
otherwise "rejected".
please implement it in core java only, don't use jdbc connection.
Andrew Thompson - 10 Aug 2007 08:48 GMT
...
>I am the new member of this group, i want code for the following
>requirements.
>it's urgent to me. Please send the code.
>
>Write a code ...
Pay me. This is a usenet dicsussion group, not a help desk.
>please implement it in ...
Please do your own homework, or vacate your place in
the course so someone who wants to learn Java can
get an opportunity.
<http://mindprod.com/jgloss/homework.html>

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Joshua Cranmer - 10 Aug 2007 23:41 GMT
> HI All,
>
[quoted text clipped - 16 lines]
> 4. If the password is accepted shpuld print the msg as "accepted"
> otherwise "rejected".
Here's the code:
def validate(pass):
if len(pass) < 4 or len(pass) > 12:
return False
if 'a' > pass[0] or 'z' < pass[0]:
return False
for x in range(len(pass) / 2):
for i in range(len(pass)-x):
if pass[i:i+x] == pass [i+x:i+2x]:
return False
return True
> please implement it in core java only, don't use jdbc connection.
Oops. Oh well, Python's close enough, right?

Signature
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth