Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

urgent need for code

Thread view: 
madhuripearl22@gmail.com - 10 Aug 2007 06:03 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.