خرید بک لینک

Vote count: -1

  1. Write a program named “password” that validates passwords. The user will enter a password. Then the program will use a function to check whether it is valid. The requirements are as follows:

The password must be 7 characters long

It must contain at least one uppercase letter

It must contain at least one lowercase letter

It must contain at least one numeric digit

Use the following algorithm for the validate function (boolean) to help you:

  1. Set the correct length variable to false

  2. Set the has uppercase variable to false

  3. Set the has lowercase variable to false

  4. Set the has digit variable to false

  5. If password length is 7 character

       Set the correct length variable to true
    
       For each character entered
    
            If the character is an uppercase letter
    
                 Set the has uppercase variable to true
    
           If the character is a lowercase letter
    
                 Set the has lowercase variable to true
    
           If the character is a digit
    
                 Set the has digit variable to true
    
    
  6. If all the above variables are true

     Set the is valid variable to true
    
    

Else

     Set the is valid variable to false

asked 5 mins ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 28 فروردين 1395 ساعت: 5:34

صفحه بندی