1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MrRissso [65]
3 years ago
8

In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions.

Computers and Technology
1 answer:
AveGali [126]3 years ago
7 0

Answer:

The program in Python is as follows:

print("Create your password which must have these.\nMust be 8 characters long.\nAt least one uppercase letter.\nAt least one number.")

pwd = input("Enter your password: ")

chkLength = 0; chkUpper = 0; chkLower = 0; chkDigit = 0

if len(pwd) == 8:

   chkLength = 1

if (any(x.isupper() for x in pwd)):

   chkUpper = 1

if any(y.islower() for y in pwd):

   chkLower = 1

if any(z.isdigit() for z in pwd):

   chkDigit = 1

if chkLength == 1 and chkUpper == 1 and chkLower == 1 and chkDigit == 1:

   print("You have set the correct password.")

else:

   print("Your password doesn't meet the criteria.")

   if chkLength == 0:

       print("It's not 8 characters long correct size.")

   if chkDigit == 0:

       print("Digit is missing.")

   if chkLower == 0:

       print("Lowercase is missing.")

   if chkUpper == 0:

       print("Uppercase is missing.")

Explanation:

This prints the instruction

print("Create your password which must have these.\nMust be 8 characters long.\nAt least one uppercase letter.\nAt least one number.")

This prompts the user for password

pwd = input("Enter your password: ")

This initializes check variables to 0 (0 - false)

chkLength = 0; chkUpper = 0; chkLower = 0; chkDigit = 0

If password length is 8

if len(pwd) == 8:

Set check variable of length to 1 (1 - true)

   chkLength = 1

If password has uppercase

if (any(x.isupper() for x in pwd)):

Set check variable of uppercase to 1

   chkUpper = 1

If password has lowercase

if any(y.islower() for y in pwd):

Set check variable of lowercase to 1

   chkLower = 1

If password has digit

if any(z.isdigit() for z in pwd):

Set check variable of digits to 1

   chkDigit = 1

If all check variables is 1, then the password is correct

<em>if chkLength == 1 and chkUpper == 1 and chkLower == 1 and chkDigit == 1: </em>

<em>    print("You have set the correct password.") </em>

If otherwise,

else:

The password is incorrect

   print("Your password doesn't meet the criteria.")

The following prints the corresponding criteria that is not met, depending on the value of its check variable

 <em>  if chkLength == 0: </em>

<em>        print("It's not 8 characters long correct size.") </em>

<em>    if chkDigit == 0: </em>

<em>        print("Digit is missing.") </em>

<em>    if chkLower == 0: </em>

<em>        print("Lowercase is missing.") </em>

<em>    if chkUpper == 0: </em>

<em>        print("Uppercase is missing.")</em>

You might be interested in
For this assignment, you will create flowchart using Flowgorithm and Pseudocode for the following program example:
satela [25.4K]

Answer:

The pseudocode is as given below in the explanation while the flow diagram is attached herewith

Explanation:

The pseudocode is as follows

input cust_name, num_texts  

Set Main_bill=5 $;

if the num_texts is less than or equal to 60

Excess_Charge=0;

If the num_texts is greater than 60 and less than or equal to 200

num_text60200 =num_texts-60;

Excess_Charge=0.1*(num_text60200);

else If the num_texts is greater than 60

num_texts200 =num_texts-200;

Excess_Charge=0.25*(num_texts200)+0.1*(200-60);

Display cust_Name

Total_Bill=Main_bill+Excess_Charge;

Total_Bill_after_Tax=Total_Bill*1.12;

6 0
3 years ago
James, a system administrator, is tasked to update the BIOS and firmware of the computer in his organization. What are the reaso
Xelga [282]

Answer:

One reason to update BIOS and firmware is to ensure they support new hardware like CPU model or graphic card. In some cases, the updates can also resolve overheating issue or motherboard issue.  

However, this is not always the case that we must update the BIOS every time there is a new release because the latest update may cause problem to existing system as well.

As a general rule, only when there are some problems with the existing BIOS and firmware, we are only required to update them.

7 0
3 years ago
Need help to answer this question​
valina [46]

Answer:

D. The sun

Explanation: Illuminated objects are objects that are capable of reflecting light to our eyes. The sun is an example of a luminous object, while the moon is an illuminated object.

3 0
3 years ago
Read 2 more answers
Is there apps/ websites like brainly?
Virty [35]

Answer:

Mathpix Snip, Socratic, Microsoft Math Solver....etc.

Explanation:

Hope this helps! :)

6 0
3 years ago
Read 2 more answers
Just forgot where she saved a certain file on her computer therefore she searched for all files with jpg file extension which ty
ollegr [7]
Photographic file also know as photos.
6 0
3 years ago
Read 2 more answers
Other questions:
  • 1. Why is it important to evaluate the website on which you plan to shop? (1 point)
    7·2 answers
  • Which of the following locations would most likely have the most fertile soil?
    8·1 answer
  • In order to recover from an attack on any one server, it would take an estimated 14 hours to rebuild servers 1, 2, 3, and 4 and
    6·1 answer
  • Addison, Inc. uses a perpetual inventory system. Below is information about one inventory item for the month of September. Use t
    15·1 answer
  • An administrator has several cables plugged into a patch panel and needs to determine which one comes from a specific port. Whic
    15·1 answer
  • People read all caps in e-mails as _____. yelling important points necessary for readability all of the above
    15·2 answers
  • salvado has a flash disk of 1.5GB and wants to store more music files of 950KBs each . How many files will he be able to store o
    8·1 answer
  • How many dog breed are there
    9·2 answers
  • (image attached)
    12·1 answer
  • Doctrine Creative is a video production company with its own file server within its business office. The company needs to be abl
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!