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
Luba_88 [7]
3 years ago
7

Having a secure password is a very important practice, when much of our information is stored online. Write a program that valid

ates a new password, following these rules:
• The password must be at least 8 characters long.
• The password must have at least one uppercase and one lowercase letter
• The password must have at least one digit.

Write a program that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. Your program should include a method that checks whether a password is valid.
Computers and Technology
1 answer:
AVprozaik [17]3 years ago
7 0

public static boolean isValid(String password) {

   Boolean atleastOneUpper = false;

   Boolean atleastOneLower = false;

   Boolean atleastOneDigit = false;

// If its less then 8 characters, its automatically not valid

   if (password.length() < 8) {

       return false;

   }

  for (int i = 0; i < password.length(); i++) {

// Lets iterate over only once.

       if (Character.isUpperCase(password.charAt(i))) {

           atleastOneUpper = true;

       }

       else if (Character.isLowerCase(password.charAt(i))) {

           atleastOneLower = true;

       }

       else if (Character.isDigit(password.charAt(i))) {

           atleastOneDigit = true;

       }

   }

return (atleastOneUpper && atleastOneLower && atleastOneDigit);

// Return true if the password is atleast eight characters long, has atleast one upper, lower and digit

}

You might be interested in
A dual looped Fibre Channel drive system is theoretically capable of transferring data at a rate of _____.
Anna007 [38]

Answer:200 MBps

Explanation: Fibre channel are those channel that work with the data transfer protocol at the rate of high speed.They work on the connection that are based on the links and loops or share any other form of point to point connection.

It is measured that theoretically the speed of the dual looped FC is supposed to be 200 MBps rate having the two loop form connection.

4 0
3 years ago
Difference between entropy and enthalpy is
olchik [2.2K]

Answer:

Explanation:

Enthalpy is the measure of total heat present in the thermodynamic system where the pressure is constant. Entropy is the measure of disorder in a thermodynamic system.

3 0
3 years ago
What are point to consider while running occupation?​
mart [117]

Answer:

if you mean running a business, i think you should have a budget and enough inventory depending on what you're selling.

Explanation:

8 0
3 years ago
Read 2 more answers
Which of the following is a benefit of using technology? a. It increases the number of human service providers in firms. b. It i
o-na [289]

Answer:

The correct option to the following question is b.) It increases quality and productivity of firms .

Explanation:

Advantages of using technology in the business:

  • It increased the quality and the productivity of the firm or business.
  • Automated the business processes with the help of an application and software.
  • It reduced the business cost by having few workers at the workplace and,
  • also increased the mobility of the firm.
  • It helps in effective communication.
6 0
4 years ago
Why can't I register for Brainly?? I've been trying for months, too! I've noticed this question has been asked so many times, bu
Alenkasestr [34]

Answer:

Just click view profile and go to preferences

Heres a screenshot :

4 0
3 years ago
Other questions:
  • What makes it possible for e-mail to be sent and received on a wide variety of devices, including cell phones, PDAs, laptops, an
    12·1 answer
  • Before installing any software, it's always important to back up your system and to create a BLANK, which enables you to go back
    6·2 answers
  • Internet-filtering software that electronically blocks out websites in specific rating categories is called _____________ by tho
    9·1 answer
  • To delete the hyperlink but keep the text, right-click the hyperlink cell, and then click ____ hyperlink
    14·1 answer
  • What are the keys in all rows that sit between the touch keys
    11·1 answer
  • A file with a .bat file extension is called a batch file. You can use a batch file to execute a group of commands, sometimes cal
    11·1 answer
  • I need help with writing the code in Python that draws an arrow pointing to the right.
    15·1 answer
  • What is the definition of trouble shooting.
    12·1 answer
  • Which option is used in Access to locate and retrieve data that may be present in multiple database tables within the database?
    10·2 answers
  • If an algorithm created to help make hiring decisions is based on previous unfair decisions, then the algorithm may be
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!