answer.
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
Novosadov [1.4K]
2 years ago
10

Search the web to discover the 10 most common user-selected passwords, and store them in an array. Design a program that prompts

a user for a password, and continues to prompt the user until the user has not chosen one of the common passwords. Ensure that you store their password and can add that to the list so they cannot choose that password when they must change their password in the future.
Computers and Technology
1 answer:
Aleonysh [2.5K]2 years ago
6 0

Answer:

passwords = ["123456", "123456789", "qwerty", "password", "111111", "12345678", "abc123", "1234567", "password1", "12345"]

used_passwords = []

while True:

   password = input("Choose a password: ")

   

   if password in passwords:

       print("You must not choose a common password!")

       continue

   elif password in used_passwords:

       print("You used this password before. Choose a new one.")

       continue

   else:

       used_passwords.append(password)

       break

Explanation:

*The code is in Python.

Initialize the passwords array with 10 most common user-selected passwords

Initialize the used_passwords array as empty

Create an infinite while loop. Inside the loop, ask the user to choose a password. Check if entered password is in the passwords or not. If it is, print a warning and ask the user to choose again using continue statement. If the entered password is in the used_passwords, print a warning message and ask the user to choose again using continue statement. If the previous conditions are not satisfied, it means the password is valid. Add the password to the used_passwords array and stop the loop using break statement.

You might be interested in
An attacker has been successfully modifying the purchase price of items purchased on the company's web site. The security admini
Kruka [31]

Answer:

Form the given statement i have come to know that the by changing hidden form values attacker has been able to modify the purchase price.

Explanation:

User can change a hidden field is not different from a common field from browser or server side.

If you want to store data then user must have to store them on server -side on a session and it is a fastest way.

8 0
2 years ago
A summer camp offers a morning session and an afternoon session.
defon

Answer:

(A) IF (IsFound

(afternoonList, child))

{

APPEND (lunchList, child)

}

Hope this helps!

5 0
2 years ago
(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the arr
Mashutka [201]

Answer:

weights = []

total = 0

max = 0

for i in range(5):

   weight = float(input("Enter weight " + str(i+1) + ": "))

   weights.append(weight)

   total += weights[i]

   if weights[i] > max:

       max = weights[i]

average = total / 5

print("Your entered: " + str(weights))

print("Total weight: " + str(total))

print("Average weight: " + str(average))

print("Max weight: " + str(max))

Explanation:

Initialize the variables

Create a for loop that iterates 5 times

Get the values from the user

Put them inside the array

Calculate the total by adding each value to the total

Calculate the max value by comparing each value

When the loop is done, find the average - divide the total by 5

Print the results

6 0
2 years ago
Mary is employed by a multinational firm, and works long hours on a desktop computer. Recently, she experienced back pain and vi
siniylev [52]
D. Avoiding sitting helps relieve stress made in the spine
4 0
2 years ago
Read 2 more answers
Sammy's Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. Write a program
murzikaleks [220]

Answer:

// here is code in java.

import java.util.*;

// class definition

class SammysRentalPrice

{

// main method of the class

public static void main(String[] args) {

    // scanner object to read input from user

    Scanner s=new Scanner(System.in);

      // ask user to enter year

       System.out.print("Enter the rented minutes:");

       // read minutes

      int min=s.nextInt();

      // find hpurs

      int hours=min/60;

      // rest  of minutes after the hours

      min=min%60;

      // total cost

      int tot_cost=(hours*40)+(min*1);

      // print hours,minute and total cost

      System.out.println("total hours is: "+hours);

      System.out.println("total minutes is: "+min);

      System.out.println("total cost is: "+tot_cost);

     

}

}

Explanation:

Read the rented minutes of an equipment from user with the help of scanner object. Calculate the hours and then minutes from the given minutes.Calculate the cost by multiply 40 with hours and minute with 1.Add both of them, this will be the total  cost.

Output:

Enter the rented minutes:140

total hours is: 2

total minutes is: 20

total cost is: 100

7 0
2 years ago
Other questions:
  • Icon view, list view, and details view are all common views provided by which kind of program?
    6·2 answers
  • While researching ideas for cutting energy costs is his company. Hector watches an online video in which a business expert says,
    6·2 answers
  • Select the correct answer. Rachel needs to make a presentation on ethics and etiquettes in college. She has about 30 minutes to
    13·1 answer
  • You complete your database, and the company begins using it. Shortly afterwards, two GearUp buyers, Cora and Owen, work together
    9·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • What is ODBC? How is it related to SQL/CLI? 10.2. What is JDBC? Is it an example of embedded SQL or of using function calls? 10.
    8·1 answer
  • The Windows ________ is a hierarchical database that stores system configuration information. It maintains files used to control
    15·1 answer
  • In cell M2, enter a formula using a nested IF function as follows to determine first if a student has already been elected to of
    12·1 answer
  • Consider a disk that rotates at 3600 rpm. The seek time to move the head between adjacent tracks is 2 ms. There are 32 sectors p
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!