50 PTS
in Java
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!

Answers

Answer 1

import java.util.Scanner;

public class JavaApplication46 {

   public static boolean passwordCheck(String pass){

       String alphanum = "abcdefghijklmnopqrstuvwxyz1234567890";

       boolean legit = true;

       if (pass.length()>= 8){

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

               if (alphanum.indexOf(pass.charAt(i)) != -1 && legit != false){

                   legit = true;

               }

               else{

                   legit = false;

               }

           }

       }

       else{

           legit = false;

       }

       

           return legit;

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter a password: ");

       String password = scan.next();

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

   }

   

}

I hope this helps!


Related Questions

where can you apply the hand wire splicing technique

Answers

Answer:

When you want to extend an electrical wire for an apparatus, e.g., a lamp or a speaker.

While an image is still being editing, it is best to save it as a PDF. Group of answer choices True False

Answers

Answer:

f

Explanation:

No because when you save it, the new editing will not count.

Who you think is better? Ninja or TFue ,btw do you know who icebear is?

Answers

Answer:

no, no i dont think i will.

Explanation:

The meaning of docile can be determined by the... context clue. synonym atonym or explanation

Answers

Answer:

Synonym

Explanation:

I'm pretty sure it's either synonym or explanation, but if there isn't an explanation, it's almost always synonym... so... synonym is correct.

Answer:

it is explanation

Explanation:

trust me


a.
Define a computer with its proper meaning.​

Answers

Answer:

Computer

Explanation:

a programmable electronic device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations.

Answer:

computer

Explanation:

An electronic machine that processes, stores data, and does calculations.

Dan frequently organizes meetings and would like to automate the handling of the meeting responses. What should he
do to automatically move those responses into a subfolder?
O Configure an automatic reply.
O Configure the default meeting request options.
O Configure a Meeting Response Rule.
O Nothing, Dan must respond individually.

Answers

Answer:

The correct option is;

Configure a Meeting Response Rule

Explanation:

Meeting Response Rule activates the sorting of incoming messages and filtering of the responses to meeting request (which by default are received in the inbox), to prevent the inbox from being filled with different meeting request response and rather, move the responses to another specified folder, thereby ensuring that the mailbox is not cluttered.

Answer:

c

Explanation:

¿En cuales situaciones concretas se puede aplicar las técnicas de conteo(particularmente las permutuaciones y las combinaciones) dentro de la informática?

Answers

Answer:

In which specific situations can counting techniques (particularly permutuations and combinations) be applied within computer science? for anybody trying to help

Select the correct answer from the drop-down menu.
Chrissie shirks the additional work given to her.
She lacks the trait of

Answers

Answer:

Responsibility

Explanation:

Which component in a CPU is responsible for transferring
data from one functional component to another?​

Answers

The data bus carries data from components to others

HOW CAN A PERSON GET BENEFITTED BY THE ICT BASEDSERVICES PROVIDED BY GOVERNMENT

Answers

Answer:

Explanation:

It aims to transform the entire ecosystem of public services through the use of information technology.ICT holds particular promise in areas of governance and public participation.  Age can use information to reduce corruption and increase government transparency, accountability, efficiency and so finally gud night guys and take care.

plz mark as brainliest

What is GIGO ?
plz answer me​

Answers

Answer:

Garbage in, garbage out

Explanation:

In computer science, garbage in, garbage out is the concept that flawed, or nonsense input data produces nonsense output or garbage

Justify the use of an e-diary in the organisation of the meeting.

Answers

Answer:

It can be used to easily organize stuff

Explanation: It can be easily used to organize meetings & write important stuff, and you will also never run out of pages, which is better than having no diary.

In most places of work, how long should it take someone to respond to an e-mail?

no obligation to respond

one hour

twenty-four hours

one week

Answers

Answer:

24 Hours

Explanation:

Now Ideally, someone when they are working should respond immediately, but its 24 hours because, if someone is in a different Timezone, Or you sent an email late and tehy read it at 12pm or something it allows them good wiggle room while giving you a dcently fast reply.

Answer: 24 hours

Explanation: It's correct

Any application that wants to be displayed on the web must use the HTTP protocol
True
False

Answers

Answer:

true

Explanation:

You have to match the letter nexts to the numbers

Answers

Answer:

Word is for business letter 4+a

2+c Monthly budget expenses

3+b is for presentation

1+d department store inventory

. Write a Python command to assign the value 80.35 to a variable called 'point'.

Answers

Answer:

point=80.35

Explanation:

the contents in cells are A1 through A6 are 6,3,4,7,9 and 7. What function would return the answer 6?​

Answers

Answer:

The formula =AVERAGE(A1:A6) would return the average of those numbers which is '6'.

Explanation:

The content in cells is A1 through A6 are 6,3,4,7,9 and 7.

As the average of 6,3,4,7,9 and 7 is 6.

If the range A1:A6 contains numbers, the formula =AVERAGE(A1:A6) would return the average of those numbers.

Therefore, the formula =AVERAGE(A1:A6) would return the average of those numbers which is '6'.

After adding an image to her flyer, Danica played around to see which layout would look the best. At one point, her text was on top of her image. Which features can Danica use to fix the issue? Check all that apply. Position feature Wrap text feature Picture dialog box Insert tab Picture tools

Answers

Answer:

Position feature

Wrap text feature

Picture tools

Explanation:

Answer:

A.) Position Feature

B.)Wrap text feature

E.)Picture tools

Explanation:

what format can be applied to text in excel?

Answers

You can apply accounting format,date,numbers, currency, percentage or even fraction

how to take a pic with a cumputer

Answers

Answer:

Ctrl+Shift+4

Explanation:

Answer:

Use Snip+Sketch on your taskbar

It looks like this~

PLEASE HURRY

In binary, an individual 0 or 1 is called a bit O True O False​

Answers

the answer is true !

Answer:

true

Explanation:

true

What number will be output by the console.log command on line 7? *
2 points
Captionless Image

Answers

Answer:

The output is 100

Explanation:

See attachment for complete question

I'll be making reference to the attachment time to time.

On line 1 of the attachment, variable fizz was declared

On line 2, variable bop was declared

Variable bop was initialised to 10 on line 3

Variable fizz was initialised to 20 on line 4

On line 5, 100 was assigned to bop

On line 6, 200 was assigned to fix

The value of bop was printed on line 7.

Note that, the current value of bop is not 100 (as updated on line 5).

Hence, the output of the program at line 7 is 100

Based on the program command displayed in the console, the output displayed by the console.log command would be 100.

The variable bop is assigned a value of 10 based on the command in line 3

In line 5 however, an update has been made to the bop variable, and the variable has been update to 100.

The newly assigned varibale value on line 5 would be the value of the bop variable unless updated again.

Hence, the output would be 100.

Learn more : https://brainly.com/question/20304083

Describe how each command is used by matching the command to its purpose.
removes data fror
places it on the cli
Paste
cancels a previou
Undo
restores a previou
Copy
duplicates data a
clipboard
Cut
Redo
places data in its

Answers

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct command matches its use are given below:

Paste   Places data in its

Undo   Cancel a previous

Copy    Duplicates data on the clipboard

Cut       Removes data for places it on the clipboard

Redo    restores a previous

Paste term is used when you are placing copied data. Undo is used to cancel a previous action performed while Redo is used to restores a previously performed action. The copy is used to duplicate data on the clipboard while Cut is used to removes data for places/ to paste somewhere else.

Why might be one reason a stock becomes more valuable over time?
A. The industry is growing
B. The company is well managed
C. There’s a lot of demand on the product
D. All of the above

Answers

The answer is D all of the above
D all of the above.

ABC IF U HAVE A LEGENDARY PET ON ADOPT ME OR ANYTHING COOL!! <3

Answers

Answer:

ABC PLEASE

Explanation:

Answer:

ABC i have mega owl and neon cow and mega frost <3

who invite computer ?​

Answers

Answer:

Charles Babbage, an English mechanical engineer and polymath, originated the concept of a programmable computer. Considered the "father of the computer", he conceptualized and invented the first mechanical computer in the early 19th century.

If you meant who ‘invented’ computers, it was Charles Babbage.
Hope this helps!

Select the correct answer. Which sign or symbol will you use to lock cells for absolute cell reference?
A.
ampersand
B.
asterisk
C.
dollar sign
D.
exclamation mark

Answers

Answer:

A. ampersand

Explanation:

Answer:

C. Dollar Sign

Explanation:

Please help.

Why I'm I getting a syntax error.

Answers

In python, the word list is a keyword. It's not meant to be used for a variable. Try changing list to lst. There also might be other parts wrong with your code. If we could take a look at your whole function, we could determine if there is anything else wrong with your code.

Order the steps for accessing the junk email options in Outlook 2016
Select Junk Email Options
Click the Junk button
Select a message
Choose one of the protection levels
Locate the Delete group on the ribbon​

Answers

Answer:

To access the the junk email options in Outlook 2016, follow the following steps.

1. Click the Junk Button

This will take you to the Junk messages that you have.

2. Select a message

Select a junk message from the list.

3. Locate the Delete group on the ribbon

The Junk email options is located in the 'Delete' group on the ribbon in the Home tab.

4. Select Junk Email Options

Click on the Junk email options button and a popup window will appear.

5. Choose one of the protection levels

Select the protection level you want from the various options listed including low, high, automatic etc.

Answer:

select a message, locate the Delete group on the ribbon, click the junk button, select junk email options, choose one of the protection levels.

Explanation:

The Quick Access tool bar allows you to customize the actions or commands you frequently use.

True
False

Answers

I believe its true.
Other Questions
Which is the best example of a description paragraph in the essay?A. Paragraph 3B. Paragraph 5C. Paragraph 6D. Paragraph 4SUBMIT Most employers list only the most significant employee tasks in a job description.FalseTrue Aidez moi plz j arrive pas a savoir les rponse (picture)complete it pls Why did the Preamble to the Constitution begin with the phrase "We the People" ? i had 50 candies yesterday, and now i have 35. find the percent of decrease Which could most likely describe the three surfaces?Surface 1 is ice, Surface 2 is gravel, and Surface 3is blacktop.Surface 1 is gravel, Surface 2 is ice, and Surface 3is blacktop.Surface 1 is blacktop, Surface 2 is gravel, andSurface 3 is ice.Surface 1 is blacktop, Surface 2 is ice, and Surface3 is gravel. Qu procedimiento debe realizar para convertir kilmetros a mililitros what does the old three hundred mean FORENSIC SCIENCE!Which of the following is an example of individual evidence when it comes to carpet? Group of answer choicesfiber lengthdye compositionthe carpet paddingthe type of fiber In the last two sentences, OBrien uses Briskly/Brisk and politely/Polite to emphasizes NormansA. Cynical AttitudeB. Poor AssumptionsC. Curt TacticsD. Rude Behavior Calculate the final temperature (once the ice has melted) of a mixture made up initially of 70.0 mL liquid water at 28 oC and 5.0 g ice at 0.0 oC. Mr. Hudson is a car salesman. He makes a fixed amount of $1,000 a month and receives $250 for every car that he sells. Which inequality shows the number of cars, n, Mr. Hudson must sell in a month to earn a minimum of $6,000? 2. Multiply and simplify: (x - 2)(2x + 3)Answer SundayMondayWhatTheFreakSaturday Stenson, Inc., imposes a payback cutoff of three years for its international investment projects. Assume the company has the following two projects available. Year Cash Flow A Cash Flow B 0 $ 64,000 $ 109,000 1 26,500 28,500 2 34,400 33,500 3 28,500 25,500 4 14,500 231,000 What is the payback period for each project? Using the table below, what is a (6(4))? can yall please help me with this 3 part question? IK this is simple math but I need help. Knowledge Check 01 An unfavorable variance of $5,000 in cost of goods sold is determined by comparing the actual results (10,000 units) and the flexible budget (10,000 units). What type of variance is described?a. Activity variance b. Spending variance c. Revenue variance