• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Documentation to Guess a Random Password (Loops Used)  RSS feed

 
Nolan Ryno
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Now I know, most people won't want to help with MY assignment, but i'm stuck beyond belief and have tried using all the references available but i cannot understand what to do. My professor has built his own class called PasswordGenerator (Documentation here -- http://www.technology.heartland.edu/faculty/todds/csci130/assignments/A5_password/doc/index.html). I have no idea how to do his very first step which is

1. Use documentation to determine the length of the password generated by the PasswordGenerator class using control structures (loops) and the appropriate methods in the PasswordGenerator class.

The Local Variables that I can use ONLY are: password (StringBuilder) & length (integer).

His first directions also state that:
The length will be stored in the 'length' local variable
The password will not be longer than 100 characters


If I could get any help or any help using this class, it would be amazing. I'm not looking to cheat, and i'm really looking to learn so I can get better and better. The more help the better. Sorry if this seems like a desperate attempt to "cheat" or "get answers", I just need some help. I know I need to use a loop first, but i'm very unsure how to go by doing that exactly.
 
Nolan Ryno
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about that..int length, and stringbuilder password are supposed to be local variables, not class variables..
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn’t have any class variables. You had two instance fields.
 
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
Nolan Ryno wrote:

Now I know, most people won't want to help with MY assignment, but i'm stuck beyond belief and have tried using all the references available but i cannot understand what to do. My professor has built his own class called PasswordGenerator (Documentation here -- http://www.technology.heartland.edu/faculty/todds/csci130/assignments/A5_password/doc/index.html). I have no idea how to do his very first step which is

1. Use documentation to determine the length of the password generated by the PasswordGenerator class using control structures (loops) and the appropriate methods in the PasswordGenerator class.


The Local Variables that I can use ONLY are: password (StringBuilder) & length (integer).

His first directions also state that:
The length will be stored in the 'length' local variable
The password will not be longer than 100 characters


If I could get any help or any help using this class, it would be amazing. I'm not looking to cheat, and i'm really looking to learn so I can get better and better. The more help the better. Sorry if this seems like a desperate attempt to "cheat" or "get answers", I just need some help. I know I need to use a loop first, but i'm very unsure how to go by doing that exactly.



There really isn't a shortcut or trick for the first step. The password generator only reports true or false. It doesn't tell you if you are hot or cold, if you are less than or greater than, etc., so your only option is just to start from zero and keep checking it, add one at a time, until you get the number. The brute force option seems to be the only option here.

[edit: just noticed that the assignment gave you the upper limit .... so just check from zero to one hundred.]

Henry
 
Nolan Ryno
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, I think I got it...


So I think I got it so that step, but I'm hoping someone can confirm it.

The next step states:
Determine the password generated by the PasswordGenerator class using control structures and the appropriate method in the PasswordGenerator class

And it hints that:

1. The password will be stored in the 'password' local variable
2. Each character in the password will be a standard ASCII character (i.e. it will have an ACSII code between 0 and 127)
3. Part of the processing for this step will necessitate the use of a method in the StringBuilder class

Hoping I can get anymore hints or help on how to do this step while I try to work on it...
 
Nolan Ryno
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm hoping this is progress..
 
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
Nolan Ryno wrote:

I'm hoping this is progress..



Aren't you supposed to use the PasswordGenerator class provided by your professor to test to see if it matches? You seemed to have written your own matchCharAt() method.

Henry
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!