its not a program is an explanation of how thankyou QUESTION 9 Write an algonthm
ID: 3722458 • Letter: I
Question
its not a program is an explanation of how
thankyou
Explanation / Answer
Algorithm:-
1.)Have a while loop to keep checking if the given parameters are met after each character entry.
2.)Inside the while loop have an if condition and a Char_length_Flag=0 to check if the user entered atleast 6 characters, if the user did enter 6 characters then set Char_length_Flag=1.
3.)Inside the while loop make another if condition and Uppercase_Flag=0 to check if the user entered an upper case letter(by checking the ASCII value of the letter), if the user did then set Uppercase_Flag=1.
4.)Make another if condition inside the while loop with Lowercase_Flag=0 to check if there is a lowercase character in the password(again by checking the ASCII value of the letter),and if true set Lowercase_Flag=1.
5.)Make another if condition inside the while loop and Number_Flag=0 to check if the user entered a number,if the user did the set the Number_Flag=1.
6.)After the user enters the password have a nested if to check the Flags and respond back to the user.
if(Char_length_Flag==1):
if(Uppercase_Flag==1):
if(Lowercase_Flag==1):
if(Number_Flag==1):
print "Password Accepted"
else
print "Your password doesn't have a number"
else
print "Your password doesn't have a lowercase letter"
else
print "Your password doesn't have an uppercase letter"
else
print "Your password cannot be blank"
7.)Restart if all the flags were not 1.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.