While loops | SoloLearn: Learn to code for FREE!

0

While loops

I’m suppose to be doing a while loop/try/catch statements In My confusing final project that is creating an authentication system with the user being able to try 3 times before being forced to exit. While also using a MD5 hash. And we haven’t even gone over MD5 yet. Any help would be appreciated, because I’m stuck at the whole loop/try catch part

2/25/2018 12:55:33 PM

Destiny Watts

28 Answers

New Answer

+5

You forgot to mention the language. And did you try anything and failed or don't know how to start?

+4

I wanted y’all to know I got a B on that final :)

+2

I've sent the eclipse project file to you. I know everyone has it's own way of codding.... but I hope it's helpful.( at least the comments should be) btw : the valid passwords are 'java' / 'code' / 'Destiny' / and of course 'Farshaad'. ;)

+2

Good job!

+1

hey I don't know if that's the problem. but after coping ur code in eclipse I found some problems. the first one was that u r missing on curlybrace at the end of the code (for "FinalProject" class) then the other thing was that u don't increment the "atempts" variable ,cussing an infinite loop even if the text file couldn't be found.

+1

I greatly appreciate all of ur help. Even if it doesn’t fully finish it is really amazing getting so much help

+1

Thank u!!!

+1

I’ll look at it when I get home.

+1

The file didn't download properly. When I opened it, it stated that it contained binary code and if I wanted to open it. When I opened it it was "s¼8áW8|œÙ OZªœËÚÕf⬜��B ¡Ÿ’¾Ö¼‚ÇpS‡N“Ù܇¾� ±%6¼znsµØÊ è↑ÁM�&œ8)0žogê2'P (ÚªýFÙ5…v6PpÞ`Ší”mãj͸J²Ê{6>Ô™Á¯¬‘J…^çè—#†Ä=ÜjòŒyÁ*q¬Êê7ÁÁZö¤¦£‡¬:ý]s£ 9îòQ"

0

I apologize its Java. I have the beginning on my computer because it’s a good way through the program. I’m confused on how to put user credentials into a while statement

0

I didn't use Java a lot yet, but it seems like the same question was asked on stackoverflow https://stackoverflow.com/questions/39809924/how-do-i-use-md5-to-convert-passwords-and-check-a-users-credentials-against-val There is a solution in the comments, but make sure you understand what's going on and not just copy the code.

0

can u send your code here (in play ground) so we have something to start on?

0

https://code.sololearn.com/cA8hkFmWeIO3/#java farshaad heydari Can you reach that link? I'm about to go to work, so any help would be amazing

0

sorry didn't understand it much.... but are u sure that u r checking if the file"credentials.txt". has next line. to read? and execute while ?

0

In all honesty I got a lot of the code from my professor and I had to fill in where the comments are. His part of the code is putting in the file, and I’m not sure how to reference it or make it read it. When I get home from work I’m going to have to try more things but I’ve been working on this for a week and can’t get any farther

0

well don't give up.... btw. what error is shown when executing this code on ur computer?

0

A lot of my issues is finishing up he code so I can turn in a working projects. Right now when I input he username and passwords it’s not using the hash and I am unsure how to code the hash into it

0

I was working on the code in eclipse..... can u send the original code that ur professor gave to u? I think I'm getting there . ..,.

0

At the moment I’m at work I can try

0

Do u have an email I could forward it to?