Page 1 of 1

password problem..

Posted: Mon Feb 18, 2008 5:36 am
by sintaksis256
hi all..
i need a help...

here the question....

One of the major threats to internet banking security is caused by improper selection of password. Most users choose an easy password to remember in order to avoid invalid login. The hassle to deal with customer service division of any bank is one of the major contributions that influence user to pick improper password. Fortunately your group is selected to enhance the selection of password given by user and make sure the internet banking response whether the password given by user and make sure the internet banking response whether the password selected by user is accepted or rejected.

Based on the analysis made towards the current password selected by the users, most of them used repeated char or letter after one another. For example:




Password---------Response

APPLE---------->Rejected (P is repeated)
CUCUMBER------>Rejected (CU is repeated)
ONION---------->Accepted(ON is not immediately repeated)
APRICOT-------->Accepted

The password given must be in capital letters. Your task is to write a program that validate whether the password given or selected by user is accepted or rejected.

i'm so crazy now..for all da experts. pls help me.... :crazy:

Re: password problem..

Posted: Mon Feb 18, 2008 5:38 am
by Benjamin
We can help you when you get stuck, but we don't do your homework ;)

Re: password problem..

Posted: Mon Feb 18, 2008 6:00 am
by sintaksis256
so sory...but u may give a hint or statement code on how to solve repeating password.. plsssss
:cry:

Re: password problem..

Posted: Mon Feb 18, 2008 9:52 am
by coolbung
well,
here's a small line which will help u find if there are repeating characters in a string.

suppose

Code: Select all

$password = 'APRICOT';
if (strlen($password) == strlen(count_chars($password,3)))
return true; // has unique chars
else
return false; // repeating chars
 

Re: password problem..

Posted: Mon Feb 18, 2008 3:17 pm
by califdon
As a retired college instructor, I can tell you that when you answer a student's homework question, you are not doing the student a favor, even though he or she may think that you are, at the time. A teacher designs homework assignments to force the students to THINK through a problem, using the resources controlled by the teacher: the textbook, lectures and class discussion. When a student goes beyond those resources, unless specifically instructed to do so, the teacher loses control of the learning process and the instruction becomes ineffective, because although the teacher may teach a certain subject, the student learns nothing. Learning is an active process that requires mental effort, not a passive process of asking someone else to answer the question. Of course, some students are forced to take courses that they have no interest in learning, but I, for one, have no motivation to help them get credit for a course in which they didn't learn anything.
[/rant]

Re: password problem..

Posted: Mon Feb 18, 2008 3:30 pm
by Benjamin
To add to what califdon said, converting real life problems into computer code can be difficult when you're first starting out. It is a key to success though and mastering that can mean the difference between being an average programmer or a master.

You really just need to step through in your head. How would you do it? If a string is 6 characters long, the longest repeatable region would be 3 characters. You can calculate this by dividing the length of the string by two. What if it's an odd number? Then what function could you use to still get an accurate result? This is where the manual comes in. Start digging around in it and become familiar with it. I think I've given you a good starting point. If you get stuck post your code and we can give you a hint on what to do next.

Re: password problem..

Posted: Mon Feb 18, 2008 4:33 pm
by califdon
You're a Good Person, astions! While my comment was aimed at our forum contributors, yours was helpful to the OP.

To sintaksis256: See, there really are people (like astions) here who do want to help you. We just don't want to give you the answer so you can get a good mark on a homework assignment without doing any thinking on your own.

Re: password problem..

Posted: Mon Feb 18, 2008 9:32 pm
by sintaksis256
i knew wt i'm doing is wrong..sory. for those who help thanks alot. :drunk: