reset password
Author Message
304374842
Posts: 56
Posted 11:45 May 14, 2016 |

I am having problems with the boolean return type.  I can get it to print valid/invalid but it also prints true.  Does anyone know how to get rid of that?

rcamach7
Posts: 31
Posted 12:15 May 14, 2016 |

Generally, with boolean types, you'd like it to return true or false, instead of bringing back a string (like you are, right?). Printing valid/invalid is only adding an extra step, just use whatever the boolean returns (true/false) and work with that.

kknaur
Posts: 540
Posted 13:58 May 15, 2016 |

You would use the method as a validator.  The method would return true or false and based on the return value, you could make a boolean expression putting all the methods together to determine if the password is valid or not.

304374842
Posts: 56
Posted 14:52 May 15, 2016 |

Okay.  I think I have the boolean part of it figured out.  My problem now is that I am having problems having it count the number of letters, numbers, characters, etc. I can get it to count the total characters but not pick out having at least a certain number of something. 

kknaur
Posts: 540
Posted 15:07 May 15, 2016 |

You should have more than enough practice with keeping a count of something. Refer to the string sentence problem from the last homework as a hint.