Search:

Type: Posts; User: Sean4u

Search: Search took 0.18 seconds.

  1. Re: For-looping, if-else statements, charAt(), etc. Beginner programming problem

    I'm not sure why you picked that example - it seems like it should result in 'true'. I notice your logic is not quite right though. Your loop tests each character in turn to see if it is invalid for...
  2. Re: For-looping, if-else statements, charAt(), etc. Beginner programming problem

    You would normally use that 'break' - or put the validity condition in your loop expression (for, while, do etc) - so that your loop stops as soon as the input is invalid because there's no more...
  3. Re: For-looping, if-else statements, charAt(), etc. Beginner programming problem

    'If' conditions evaluate to a boolean - one of two values. If you're studying computing, you should probably read up on DeMorgan's Laws for the background to why this code works out this way, but you...
  4. Re: For-looping, if-else statements, charAt(), etc. Beginner programming problem

    You should only be using one for loop for this like (pseudo code)


    check strings are same length
    for (all characters or positions in one of the strings)
    if (character in first string is *)
    ...
  5. Re: For-looping, if-else statements, charAt(), etc. Beginner programming problem

    The easiest way to tackle this might be to check first if *either* char is a wildcard, and if it is go on to the next char.
Results 1 to 5 of 5