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
nasty-shy [4]
3 years ago
11

Write a program with a method called passwordCheck to return if the string is a valid password. The method should have the signa

ture shown in the starter code.
The password must be at least 8 characters long and may only consist of letters and digits. To pass the autograder, you will need to print the boolean return value from the passwordCheck method.
Hint: Consider creating a String that contains all the letters in the alphabet and a String that contains all digits. If the password has a character that isn’t in one of those Strings, then it’s an illegitimate password!
Coding portion:
public class Password
{
public static void main(String[] args)
{
// Prompt the user to enter their password and pass their string
// to the passwordCheck method to determine if it is valid.
}
public static boolean passwordCheck(String password)
{
// Create this method so that it checks to see that the password
// is at least 8 characters long and only contains letters
// and numbers.
}
}
Computers and Technology
1 answer:
Ber [7]3 years ago
6 0

Answer:

import java.util.regex.*;

import java.util.Scanner;

public class Password

{

  public static void main(String[] args) {

  Scanner input = new Scanner(System.in);

  System.out.println("Please enter the Password. \n");

  String passwordString = input.next();

  System.out.println(passwordCheck(passwordString));

  }

  public static boolean passwordCheck(String password){

  if(password.length()>=8 && password.matches("[a-z0-9A-Z]+")){

  return true;

  }

  else{

  return false;

  }

  }

}

Explanation:

The Java class "Password" is used by the program to make an instance of the password object and check its validity with the passwordChecker method defined within the Password class. The passwordChecker method only matches alphanumeric passwords, that is, passwords with alphabets and numbers. If a non-alphanumeric character is encountered, the boolean value false is returned.

You might be interested in
Desktop Management software requires managers to install software such as antivirus updates or application updates on client com
Natali [406]

Answer: False

Explanation: Desktop management is the managing of the computer system and its elements .They also supervises the data organization , network management, etc.

The desktop management software requires automatic installation rather than being installed by the managers.The updates for the antivirus or application occurs after a certain period of time intervals automatically because of the inbuilt feature of the software . So, the given statement is false.

5 0
4 years ago
Draw a flowchart to convert 5 kg into gram .​
dlinn [17]

Answer:

Kg to g, multiply by 1000

Therefore, 5 Kg = 5000 gms

Explanation:

5 0
3 years ago
Read 2 more answers
Legal functions are the most important area of IG impact. Under the FRCP amendments, corporations must proactively manage the e-
AfilCa [17]

Answer:It can jeopardize your chain of custody, but also expose sensitive data to the wrong people.

Explanation:

6 0
3 years ago
How is a worm different from a Trojan?
olga_2 [115]

Answer:

C. A worm spread through a network, whereas a trojan hides inside another program.

Explanation:

Worms spread through computer networks, a great example of a popular computer worm that struck the world is the "ILOVEYOU" / "Love Letter for You" worm. The malware infected over ten million personal computers and was spread via the user's email and sent to all addresses in the user's address book.

A trojan virus is essentially a piece of malicious software that looks legitimate from the outside but in under the seal it's highly malicious and destructive; hence how it got it's name "Trojan Horse" which is a reference to an Ancient Greek story of deception.

8 0
3 years ago
Media literacy teaches today's students how to
STatiana [176]

Answer:

Locate reliable sources

6 0
3 years ago
Other questions:
  • 6. Into how many areas are Blender®’s main screen separated? (1 point)
    15·2 answers
  • Create an array of strings. Let the user decide how big this array is, but it must have at least 1 element. Prompt them until th
    8·1 answer
  • Complex machines are defined by...
    14·2 answers
  • Match the job titles to the tasks
    11·2 answers
  • ____ is (are) the abuse of e-mail systems to send unsolicited e-mail to large numbers of people.
    14·1 answer
  • PLEASE HELP
    12·1 answer
  • Discuss any five factors that hinder the application of a computer in business organisations​
    15·2 answers
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
  • Brianna is taking a backpacking trip in the wilderness and wants to back up the photos from her camera. Which type of storage de
    10·1 answer
  • WILL GIVE BRAINLIEST!!! Danielle is warehouse supervisor for a large shipping company. Most shipments need to leave the warehous
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!