• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java invalid password application  RSS feed

 
Ata kuzuimamlar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I need to create a method called "invalidPassword" accepts a String as an argument and returns true if the password is invalid, false otherwise.
It's my assignment and i have no idea how to make it. Any help?

Cheers.
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your definition of a "valid" password?
 
Ata kuzuimamlar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:What is your definition of a "valid" password?



Valid password should be a password that i choose. For example "Project"
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ata kuzuimamlar wrote:
Valid password should be a password that i choose. For example "Project"


I don't think Carey meant the question literally. Of course, the password has to be set somehow.... but... Where is it set? File? Database? How is it set? Is it encrypted? What do the method have to do to protect the password? etc. etc. etc.

Henry
 
Ata kuzuimamlar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Ata kuzuimamlar wrote:
Valid password should be a password that i choose. For example "Project"


I don't think Carey meant the question literally. Of course, the password has to be set somehow.... but... Where is it set? File? Database? How is it set? Is it encrypted? What do the method have to do to protect the password? etc. etc. etc.

Henry


Well i kind a copy-pasted the question. This is what my teacher wants. Didn't mentioned how to set or where to set.

create a method called "invalidPassword" accepts a String as an argument and returns true if the password is invalid, false otherwise.

thats what he asks.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ata kuzuimamlar wrote:Well i kind a copy-pasted the question. This is what my teacher wants. Didn't mentioned how to set or where to set.

create a method called "invalidPassword" accepts a String as an argument and returns true if the password is invalid, false otherwise.

thats what he asks.

First of all, from the question, I am not even sure if the purpose is to check the password to see it matches with the correct password that you chosed. Or is the purpose to check the password to see if it is valid based on rules such as, minimum length, number of letters/numbers, special characters, etc.

... but ... regardless, for either case, you don't have enough information to implement it. This means that you will either have to get more information from your teacher, or define it yourself (and document it for your teacher). Otherwise, you can't implement something that doesn't have a specification.

Henry
 
Ata kuzuimamlar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is basically, i need to write a program that asks for password and if the password is invalid returns to question.
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Henry says, unless you can define for us ( and more importantly for yourself) what "invalid" means in this case then you cannot actually write this method.

Henry has given the two obvious possibilities, which are validating against a particular password and validating a password against a set of rules.

The former would be for logging into somewhere, the latter would be for setting a password.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!