Write a program with a method called passwordCheck to return if the string is a valid password. The method should have the signature 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.
}
}

Answers

Answer 1

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.


Related Questions

If you need to change the typeface of a document, which menu will you choose?

Answers

Format menu

Format menu is used to change typeface of a document

The New Slide command on the Ribbon lets you choose ________.
Question 3 options:

slide dimensions

print settings

slide layouts

transitions

Answers

Answer: slide layouts

Explanation:

Just took the test hope this helps ❤️✨

The New Slide command on the Ribbon lets you choose slide layouts. Thus, option C is correct.

What is  New Slide?

Make your arrangement selection in the New Slide message box for your new presentation. Study slide layouts in more detail. Choose Add Slide. That new slide has now been added, allowing you to start adding information by clicking within a placeholder.

You may select slide patterns using Ribbon's New Slide command. To have the new slide display just below the selected slide there in the slide window, click on that slide. On the Insert tab, in the Slides grouping, choose the New Slide option.

The fresh slide needs to be displayed beneath the current slide. Select the initial of the two rolls and initiatives Slide to insert a new slideshow seen between existing ones. Therefore, option C is the correct option.

Learn more about  New Slide, here:

https://brainly.com/question/1372598

#SPJ2

Which line of code will move the raft to the Skykomish River?

class raft:
def __init__(self,capacity):
self.capacity = capacity
self.location = 'Gauley'
self.repairs = []


def moveRaft(self, newLocation):
self.location = newLocation
myRaft = raft(30)




A. myRaft.moveRaft(self,'Skykomish')​

B. myRaft.moveRaft('Skykomish')​

C. moveRaft('self, Skykomish')​

D. myRaft.moveRaft() = 'Skykomish'

Answers

Answer:

myRaft.moveRaft('Skykomish')​

Explanation:

myRaft = raft(30)

myRaft.moveRaft('Skykomish')

If you add the following line, you can see that the raft is now located on the Skykomish River.

myRaft.moveRaft('Skykomish')​ is the line of code will move the raft to the Skykomish River. Hence, option B is correct.

What is Skykomish River?

Given that the North and South Forks of the Skykomish Rivers pass through it, the Upper Sky Valley is a canoeist and angler's dream. The Sky Valley's world-class whitewater rapids are a great option if you're searching for a wilder ride than floating around or wading into many fishing holes.

The Skykomish River will be navigable from its mouth to the point where its north and south forks meet. There will be no impediments in the Snoqualmie River from its mouth to Snoqualmie Falls. As long as the fishery is open, which is anticipated to last until anglers are allowed to keep up to two coho salmon that are at least 12 inches in length.

Thus, option B is correct.

For more information about Skykomish River, click here:

https://brainly.com/question/29104642

#SPJ2

what type of computer is an ATM attached to ?

Answers

ATM machine uses a CPU to control the user interface and transaction devices

If this doesn’t help lmk I can add something else

Which of the following calculates to 10?
3*(6+2/2)
(3* 6) + 2/2
(3* 6+ 2)/2
3*6+2/2

Answers

Answer:

C. (3* 6+ 2)/2

Explanation:

Arithmetic operation are performed sequentially using the rule known as bracket of division, multiplication, addition and subtraction (BODMAS).

(3* 6 + 2)/2

Simplifying the above mathematical expression, we have;

(18 + 2)/2

= 20/2 = 10

Kevin needs to get his data from a database into a text file to send to another group. He needs to _____.

A. export
B. sort
C. link
D. import

Answers

A.Export

I got it right on test

Answer:

pretty sure that it would be A. Export :)

----------------------------------------------------------------------------------------------------------------

Explanation:

Because B and C don't make too much sense, and D would mean to 'bring in' and A means the opposite, which is take out.

write algorithm and flowchart to calculate sum,difference, product and quotient of two integer number given by the user.​

Answers

Answer:

Step1: Start

Step2: Initialize the count variable to zero

Step3: Initialize the sum variable to zero

Step4: Read a number say x

Step 5: Add 1 to the number in the count variable

Step6: Add the number x to the sum variable.

Step7: Is the count variable in the memory greater than 50?

           If yes, display the sum: go to step 8.

           If No, Repeat from step 4

Step8: Stop

Explanation:

If I want to control the aperture and I want the camera to control the shutter speed which setting on the mode dial is most appropriate?
a)AV
b) TV
c) M
d) P
since this is my last question im giving 100 points and brainliest

Answers

Answer:

answer is a

hopes this helps

Add the beginning comments at the top of the program.
In the first part of your program, create a for loop that runs three times:
Inside the for loop, prompt the user for an integer
Prompt the user for another integer
Call the function compare (you are going to create this function next)
Pass the variables that you used for the integer inputs from above
Create a function called compare (remember the function definition should go at the top of the program) and use two variables in the parameters of the function:
Inside of the function, create an if / elif / else structure that compares the two values passed into the function
If one value is less than the other, output that to the user (Ex: 2 is less than 4)
Elif the other value is less than the other output something similar (Ex: 4 is less than 9)
Else, output that they are equal to each other
That is it for the first part of the program.
Next, create an empty list called names.
Create a loop that runs 6 times:
Inside of the for loop, prompt the user for a name
Append the name to the list
Outside of the for loop, prompt the user for how many people they would like to vote off the island.
Call the function eliminate and pass the variable you used from step 7 to it.
Also, this function will return a value, so store this back function call back to a new variable.
Create a function called eliminate and create a variable to use as the parameter:
Inside the function, randomly shuffle (use the shuffle() method) all the values in the list (you will need to import random at the top of the program)
Then using a for loop, loop it as many times as the value that was passed to the function:
Inside the for loop, remove one name from the list (use the pop() method)
Outside the for loop, but still inside the function, return the list of remaining people
Underneath where you left off in step 8, print the remaining people that are left: those that did not get voted off the island.
WILL GIVE BRAINIEST!

Answers

Answer:

#################

# Python Practice

#################

# Part 1

# ------------------------------------------------------

run_compare = 3

ran_compare = 0

while run_compare != ran_compare:

   num1 = int(input('Please input the first number: '))

   num2 = int(input('Please input the second number: '))

   def compare(number1, number2):

       if number1 < number2:

           print(f'{num1} is less than {num2}')

       elif number1 > number2:

           print(f'{num1} is greater to {num2}')

       else:

           print(f'{num1} is equal than {num2}')

   compare(num1, num2)

   ran_compare += 1

# ------------------------------------------------------

# Part 2

run_name = 6

ran_name = 0

names = []

# ------------------------------------------------------

while run_name != ran_name:

   name = input(str('Please insert a name: '))

   names.append(name)

   print(names)

   ran_name += 1

# ------------------------------------------------------

give me a second im going to resolve the last part but this is what i have so far

Following are the program to the given question:

Program Explanation:

Import random package as r.Defining a method "compare" that takes two variable "n1,n2" inside the parameter.In the next step, a conditional statement is declaed that checks the parameter value and prints its value. Defining a method "eliminate" that takes two variable "n, names" inside the parameter.It calls the shuffle method, and define a for loop that removes names value and return its value.In the next step, a for loop is defined inside this two variable "i1, i2" is declared that inputs value and calls the comapre value.In the next line, an empty list "names" is declared inside this a for loop is defined that inputs name value and calls the "eliminate" method and print its calculated value.

Program:

import random as r#import package random

def compare(n1, n2):#defining a method compare that takes two parameters  

   if n1<n2:#defining if block that checks n1 value less than n2 value

       print("{} is less than {}".format(n1, n2))#print value with the message

   elif n2<n1:#defining if block that checks n2 value less than n1 value

       print("{} is less than {}".format(n2, n1))#print value with the message

   else:#defining else block

       print("{} and {} are equal".format(n1, n2))#print value with the message

def eliminate(n, names):#defining a method eliminate that takes two parameters

   r.shuffle(names)#calling the shuffle method

   for i in range(n):#defining a for loop that checks n values

       names.pop()#calling pop method to remove value

   return names #return a names value  

for i in range(3):#defining a for loop that inputs value

   i1 = int(input("Enter an integer: "))#defining i1 value to input value

   i2 = int(input("Enter another integer: "))#defining i2 value to input value

   compare(i1, i2)#calling the compare method  

   print()#using print to break line  

names= [] #defining an empty list      

for i in range(6) :#defining a loop that inputs name value

   name = input("Enter name: ")#defining name variable that inputs value

   names.append(name)#calling append method  

n = int(input("\nHow many people you would like to vote off the island: "))#defining n variable that input value

new_names = eliminate(n, names)#defining new_names that calling eliminate method

print("\nRemaining people that did not get voted off the island:")#print message

if(len(new_names) != 0):#defining if block that checks new_names length not equal to 0

   for name in new_names:#defining a for loop that checks name is in new_names

       print(name)#print name value

else:#defining else block  

   print("None")#print message None

Output:

Please find the attached file.

Learn more:

brainly.com/question/21922031

The Register Set that stores temporary results related to the computations are

Answers

Answer:

ooh Bhai sahab

Explanation:

ooh Bhai Yaar Mata tyo gari sanisanisanisani

What is a segment?
1. a set of data or information
2. the main piece of cable in the network
3. a piece of hardware connecting pieces of cable
4. a length of uninterrupted cable connecting two devices

Answers

Segmentation divides a computer network into smaller parts. The purpose is to improve network performance and security.

Hope this helps!!

Write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs the smallest and largest integers in the list.

Ex: If the input is:

10
5
3
21
2
-6
the output is:

2 and 21

Answers

n = 1

lst = []

while n > 0:

   lst.append(n := int(input()))

lst.pop(-1)

print(str(min(lst)) +" and "+str(max(lst)))

I wrote this code in python 3.8. I hope this helps

What is the best approach to testing a website? visit all pages to verify that they load visit every page and verify all links visit the pages with hyperlinks visit all pages that appear on the navigation menu

Answers

Answer:

B. visit every page and verify all links

Explanation:

I just took the test, and only one year late.

Answer:

THe answer s b

Explanation:

The U.S. military's standard for computer security is known as
DCS-3000.
TEMPEST.
Daubert standard.
Carnivore.

Answers

daubert answer lllllllll

A(n) __________ records the activities of computer operators surrounding each event in a transaction.
A. threat analysis
B. audit trail
C. DNA profile
D. expert systems analysis

Answers

Answer:

B. audit trail

Explanation:

A(n) audit trail records the activities of computer operators surrounding each event in a transaction.

I believe the answer is b

Given all of the limitations of MBR, is it still relevant in current day use?

Answers

Explanation:

MBR does have its limitations. For starters, MBR only works with disks up to 2 TB in size. MBR also only supports up to four primary partitions—if you want more, you have to make one of your primary partitions an “extended partition” and create logical partitions inside it.

What do you understand by storage devices ? Name any two storage devices.​

Answers

Answer:

Types of storage devices

Primary Storage: Random Access Memory (RAM) Random Access Memory, or RAM, is the primary storage of a computer. ...

Secondary Storage: Hard Disk Drives (HDD) & Solid-State Drives (SSD) ...

Hard Disk Drives (HDD) ...

Solid-State Drives (SSD) ...

External HDDs and SSDs. ...

Flash memory devices. ...

Optical Storage Devices. ...

Floppy Disks.

Answer:

this are the 2 examples of storage device

Hard Disk Drives (HDD)

Solid-State Drives (SSD)

Explanation:

basically storage device is a piece of hardware that is primarily used for storing data.

I hope it helps mate

mark me brainliest plsss

I will always help you understanding your assingments

have a great day

#Captainpower :)

Jordan uses a spreadsheet to keep track of how many hits each player on a baseball team has had in each game
throughout the season. For every game, each player's name appears in a column that Jordan has titled "Player."
Next to that, a column titled "Hits" shows the number of hits for each player in a single game.
What function should Jordan use to find the average number of hits per game for player A_Clemente?
O SUMIF(Hits, "A Clemente", Player)
O SUMIF(Player, "A Clemente". Hits)
O AVERAGEIF(Hits, "A Clemente", Player)
O AVERAGEIF(Player,"A_Clemente", Hits)

Answers

Answer:

AVERAGEIF(Player, "A_Clemente", Hits)

Explanation:

The AVERAGEIF function allows users to calcule the mean value of numerical columns while also Given certain constraints within a single function call. The AVERAGEIF takes in 3 arguments.

The first is a column which houses the range of the constraint we would like to apply on our function.

The second argument is the constraint itself which should reside within the values in the range defined in the first argument.

The third argument is the numerical column whose average is calculated based on the defined constraint.

Therefore, in the scenario above, Player is the column containing player names, which it's value will later be used as a constraint

"Clemente_A" the constraint, only values pertaining to Clemente_A will be defined.

Hits, the numeric column whose value is averaged based on the constraint given.

Explain the consequences of using bits to represent data.

Answers

Answer:

Each description of a PC needs to clarify how the PC handles data: numbers, text, pictures, sound, films, directions.

Using bits to represent data implies that the computer has to use a lot of memory since every character has a group of bits representing it.

The PC is an electronic gadget. Every one of its wires can either convey electric flow or... not convey current. Thus, similar to a light switch, it sees just two states. Incidentally, this is sufficient to make the entire thought work. Indeed, any framework that can speak to in any event two states can speak to data. Take, for instance, the Morse code that is utilized in telecommunication. Morse is a sound transmission framework that can convey a short signal (spoke to by a dab) and a long beeeeeep (spoke to by a scramble). Any letter or number can be spoken to by a mix of these two images. Snap here to see a Morse interpreter.

Explanation:

Essentially with PCs. To speak to a number, we utilize the parallel number-crunching framework, not the decimal number framework that we use in regular day to day existence. In the double framework, any number can be spoken to utilizing just two images, 0 and 1. (Morse is nearly, yet not exactly (because of the delays between letters) a paired framework. A framework firmly identified with Morse is utilized by PCs to do information pressure (more about this later).

A bit  which is also called a binary digit is the smallest unit of data. A combination of two or more bits is regarded as bytes.

A bit is usually processed by the electrical parts of a computer system. Internet speed is measured in bits and it reflects two opposite commands which could be either yes/no , on/off etc.

The consequence of using bit to represent data is due to the advantages which includes:

Easy computation : Due to the simplicity and it involving less complex calculations, the bits gives room for less errors.

Ease of Coding: The bits is the simplest and smallest unit of data which makes it less stressful when used in coding operations.

Ease of Operation: Devices which operates with the bits system makes it easier for humans to operate when compared to other complex forms.

Read more on https://brainly.com/question/19667078

If there is a need to write code in order to help the player move through the game, which team member would create this code?

Answers

Answer:

the main programmer

Explanation:

or the person who studies the algorithm and writes the code

hence, the programmer or main programmer

A software engineer is somebody who develops, creates, maintains, tests, and evaluates software using principles of software development. The term "programmer" is sometimes used as a synonym, although it may also imply a lack of engineering degrees or abilities.

Software developers, sometimes known as software architects, collaborate closely with clients to plan and develop software. Most software engineers do not start coding, they do establish a strong foundation in programming skills in order to communicate successfully with programmers.It must cover the full software development, commencing with only an analysis of the needs and ending with the design, test, and development of the technology to suit these goals.

Therefore, the answer is "Software Engineer".

Learn more:

brainly.com/question/23661471

When save a newly created template, you use which extension for the file type? .doc, .docx, .doct, .dotx?

Answers

Answer:

The main difference between the two file formats is that in DOC, your document is saved in a binary file that includes all the related formatting and other relevant data while a DOCX file is actually a zip file with all the XML files associated with the document.

write a an algorithm to find out volume?​

Answers

This for the algorithm of a sphere:
Define the radius of the sphere.
Define the pie and assign (22/7)
Calculate the volume of the sphere as (4/3)*pie*r3
Assign the volume of the sphere to volume_of_sphere.
Print the volume of the sphere.

explain the major innavotions made from the establishment of abacus​

Answers

Answer:

The abacus is one of many counting devices invented to help count large numbers.

Explanation:

Any one know 23 24 25?

Answers

23- B
24- C
25- i’m not sure what it is but the definition to it is that it represents a range of text that has been deleted from a document. so which ever one is closest to it.

Explain to Alana why she might not want to blast her boss on social media just yet.

Answers

Answer: She might get fired. And who knows, if she doesn't, she might get a raise!

If any one has mincraft on ps4 bedrock we can finish building a BIG city world all we need to put is a shop and money dispensers thx

Answers

Answer:

cool i want a ps5

Explanation:

What’s the term for a current flow in which electrons move in one direction

Answers

Answer:

Direct Current

Explanation:

MARK ME BRAINLIEst pls

What is the name of the tab that becomes available after you add and select an image in your PowerPoint presentation?
Home
Insert
Picture
View

ASAP PLS

Answers

Answer:

INSERT

Explanation:

INSERT PCIURE

For all programs, you should write a small amount of code and _______
it before moving on to add more code?

Answers

Answer:

test

Explanation:

One newly popular development paradigm is "test-driven development"; which borrows agile engineering principles in architecting project components.

April is worried that she is not a "good speller" so she plans to let the spelling checker correct all her mistakes. What would be the most helpful advice for April?​

Answers

Answer:

Likely, the best option would be to use the "auto-correct" function found on Microsoft Word or Google Docs. There are other forms of spell-checking such as Grammarly or by using a dictionary.

Explanation:

They have tools meant for checking for grammatical errors and can be used to better enhance your overall writing.

Other Questions
Which point on the number line represents the product of 4 and 2?Point APoint BPoint CPoint D Which of the following correctly describes the required proportions for milk chocolate?A. minimum of 12% milk solids and 10% chocolate liquidB. minimum of 23% milk solids and 18% chocolate liquidC. maximum of 50% milk solids and 50% chocolate liquidD. maximum of 80% milk solids and 20% chocolate liquid Original price: $10 New price: $7Is it a discount,Or a mark up. what is a wind vane used to find?a, the amount of rainfall.b, wind speed.c, wind direction.d, relative humidity. Do you think Katniss should have helped the Avox girl when she saw her in the woods? Why or why not? 9 3/5 as a improper fraction How to multiply Decimals by power of 10? I NEED HELP ASAP!!World history What is a theme of "Damon and Pythias"? Write an inequality for the graph below what is one standard kilogramun si system which of the following philosophies is most directly reflected in the situation described by alexis de tocqueville in the republic of the united states of america A)FederalismB)Constitutionalism C)Jeffersonian democracyD)Market capitalism The graph below shows a system of equations:5y = -x + 5.432K++0-126y = x - 1-2-3+-57The x-coordinate of the solution to the system of equations is(5 points) what to come to the gaps What is the correct answer? Lina holownicza wytrzymuje dziaanie siy o wartoci co najwyej 1400 N (wiksza sia powoduje rozerwanie liny). Oblicz maksymalne przyspieszenie, jakie moe osign samochd o masie 2000 kg holowany na takiej linie po poziomej jezdni, jeeli wiadomo, e czna warto si oporu ruchu tego samochodu w czasie holowania wynosi 400 N. Do white even have a culture? Write MOP (Indirect object pronouns) A subject pronouns) or N c for noun/name) to thefollowing:leellanosotrostoMarialesEl, usted, osoIellos, ellas, ustedesJose, Miguel, AnanosYOme Which of the following represents a function PLZ HELP ME AND I WILL MARK BRAINLIEST!!!