Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+33 votes

Is there anything wrong with the piece of Hannaldous code where it sees if the character is not a uppercase or lowercase letter? Or any other common issues with that method because I thought I had it fixed but it isn't noticing certain symbols.

asked in CSC285_Fall2018 by (8 points)

3 Answers

+19 votes

The code should function (or at least how I think it was intended to function) is that if the code contains any non-alphabetical character, it should fail the test and not be considered a good password.

answered by (8 points)
+18 votes

I talked with Dr. Stonedahl about this earlier and he told me that the method is checking if the character is contained within 'a' and 'z' as well as 'A' and 'Z' on the ascii table of characters. the method is designed to check if the character is any symbol not within those intervals on the ascii table.

answered by (8 points)
+18 votes

There is no problem with the logic of this Code. The second method just check there are full of letters or not. Even if you feel that is some problems, you can't change the logic of code, you only can make it easier to read.

answered by (8 points)
+6

Yes -- this is important! You aren't trying to fix Hannaldous code. You are trying to refactor it. There is a difference!

...