This topic has been cross posted
here.
Since I haven't been getting any replies on that topic, I figured I would post this same question on this site.
Some Websites impose certain rules for passwords. Write a method that checks whether a
string is a valid password. Suppose the password rule is as follows:
A password must have at least 8 characters A password consists of only letters and digits A password must contain at least 2 digits
Write a program that prompts the user to enter a password and displays "Valid Password" if the rule is followed or "Invalid Password" otherwise.
Here is my most up to date code:
My code compiles and runs. The only part that isn't working is the part that checks to see if the password has at least 2 digits. How would I correct this?