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

write the seven tasks of previntng maintenance?​

Answers

Answer:

These are testing, servicing, calibration, inspection, adjustment, alignment and installation. Every maintenance team member should be conversant with and apply them accordingly. A preventive maintenance is a crucial component of every company's TPM program.

Which of the following is NOT an example of application software?
Internet Explorer web browser
Photoshop image editing program
Microsoft PowerPoint presentation software
Windows operating system

Answers

Application software is a type of software that also carries out another personal, educational, and business function, and its further discussion can be defined as follows:

Each application is designed to support the user in a particular process that could be associated with productivity, creativity, and communication.In this question except for Windows all "web browser,  Photoshop, and presentation software" is a type of Application software, that is run on OS.  Windows is a software accumulation known as just an OS that controls a PC (personal computer).

Therefore, the final answer is "Windows operating system ".

Learn more:

brainly.com/question/2949220

Complete the sentence.
A _______ error might appear when you are attempting to view a secure web page

Answers

Answer:

An internal server error

Which of the following statements best compares and contrasts the role of editors in a television news room and editors at a newspaper?

a.) Both television and print editors work to ensure the quality of production; however, television editors must have a background in film media.
b.) Both television and print editors must make sure content is accurate and appropriate; however, print editors must also consider the length of the content.
c.) Both television and print editors must make sure their sources are reliable; however, fewer people read print news, so fewer would know if a print editor makes a mistake.
d.) Both television and print editors work under tight deadlines, which cause a great deal of stress; however, print editors finish their work sooner than television editors.
Need this now please, thank you!!!!

Answers

Answer: It is A

Explanation:

Question # 6 Fill in the Blank You designed a program to create a username using the first three letters from the first name and the first four letters of the last name. You are testing your username program again for a user whose name is Paula Mano. The output should be

Answers

Its PuaMano

Explanation:

got it wrong and it shows this answer for edge

HELP!!!!!
Your colleague has made a suggested change to an important document you are both working on. You disagree with their suggested change. They will be reviewing the changes you make before the final version of the document is submitted to your boss. You both work remotely and are in radically different time zones. What is the best step to take next?

Answers

Leave the room and let someone else figure it out!

what is media ethics. Explain two forms of maintaining media ethics with examples​

Answers

Media ethics is the best division of applied ethics dealing with the specific ethical principles and standards of media, including broadcast media, film, theatre, the arts, print media and the internet. The field covers many varied and highly controversial topics, ranging from war journalism to Benetton ad campaigns. In relation to news coverage it includes issues such as impartiality, objectivity, balance, bias, privacy, and the public interest. More generally, it also includes stereotyping, taste and decency, obscenity, freedom of speech, advertising practices such as product placement, and legal issues such as defamation.

why is it when you put earbud aux cords in a phone or computer they sound weird until you move the aux cord? Then it is somehow clear. Why?

Answers

Answer:

that might just be the headphone cord itself or it might be the port on the pc/phone

Explanation:

i had this happen with my old droid razr hd i thought it was the aux cord on my speaker and head phones but i used the same things on a friends phone and they worked just fine and this might be do to an old  or broken port on the phone /c my phone headphone port got used almost everyday and it was just the port you can replace this on some tech or you could just use bluetooth if the tech doesent have it buy and adapter.

            hope this helps!!!

Which precaution should you take while working on a computer

Answers

Answer: Maintain a cool temperature to avoid sweating

Explanation:

Which of the following is true of functions? * 2 points A. Programs written with functions run more quickly B. Functions can help remove repeated code from a program C. Replacing repeated code with a function will reduce the number of commands the computer needs to run D. Functions are called once but can be declared many times

Answers

Answer:

I’m sure if I remember that this is “B.”

Explanation:

I have taken computer science class before so I remembered!

The option that is true of functions is B. Functions can help remove repeated code from a program.

It should be noted that the fact that programs are written with functions doesn't mean that they will run quickly.

Functions can help remove repeated code from a program. Also, replacing repeated code with a function doesn't reduce the number of commands the computer needs to run.

Read related link on:

https://brainly.com/question/17691320

Where should citations be included in your research paper? Select all that apply.

In the header

At the end of every paragraph

As footnotes

In a separate Works Cited page

(EASY!!! BUT I NEED HELP PLEAASE!!!)

Answers

Answer:

in a separate works cited page

Which of the following ideas would not be appropriate for an essay
comparing two dog breeds?
A. Terriers are feisty and smart, which can cause headaches for their
owners.
B. My dog Sally would play fetch for hours.
C. With a couple of exceptions, terriers are smaller than retrievers.
O D. Broadly speaking, retrievers are docile and friendly.

Answers

Answer:

B.

Explanation:

The following ideas would not be appropriate for an essay comparing two dog breeds:  My dog Sally would play fetch for hours. Thus option (B) is correct.

What is an essay?

An essay is defined as a brief formal piece of writing and an essay deals with a particular subject. It is generally written to try to influence the reader using selected research evidence.

In general, an academic essay has three parts:

An introduction part ,that provides the reader an idea of what they are about to learn and presents an argument in the form of a thesis statement

A body part, or middle section, that provides evidence used to prove and persuade the reader to accept the writer's particular point of view

A conclusion that summarizes the content and findings of the essay.

The following ideas would not be appropriate for an essay comparing two dog breeds:  My dog Sally would play fetch for hours. Therefore, option (B) is correct

Learn more about an essay here:

https://brainly.com/question/20426054

#SPJ5

It means fruit- trees garden.

Answers

Answer:

What does?

Explanation:

Do you have a question?

Choose the term that describes each step of the cycle.

------- : gets next instruction

---------- : interprets instruction

----------- : carries out instruction

------------ : saves result of instruction

Answers

Answer:

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

Explanation:

This question is about to tell the best and suitable terms for the given descriptions in the question.

As we know that a computer program is based on sets of instructions. The CPU carries out the processing using the fetch decode and execute cycle.

It is responsible for implementing a sequence of instructions called a computer program that takes input, processes them, and outputs the result based on processing.

A CPU mainly has three components such as control unit, Arithmetic logic unit,  and register.

The control unit controls all parts of the computer system. It manages the four basic operations of the Fetch Execute Cycle such as Fetch, Decode, Executes, and Storage.

So the correct terms of this question are:

Fetch: Gets next instruction

Decode: interprets the instruction

Execute: Carries out instruction.

Store: Save results of instruction.

Answer:

A). Fetch : gets next instruction

B). Decode : interprets instruction

C). Execute : carries out instruction

D). Store : saves result of instruction

Explanation:

I just did the Test on EDGE2020 and it's 200% correct!  

Also, heart and rate if you found this answer helpful!! :) (P.S It makes me feel good to know I helped someone today!!)  :)

How do commands inside an onEvent run different from commands outside?

Answers

Answer:

This is probably the most important reason. In an event-driven architecture, there can be no question that an event raised represents something that has happened.

Now, because Commands are something we want to happen, and Events are something that has happened, we should be using different verbs when we name these things. This drives separate representations.

Icon view, list view, and details view are all common views provided by which kind of program?
a web browser to view web pages
a word processor to view headings
a file browser to view folders
a file manager to view files and folders

Answers

Answer: The standard program that uses common views such as the icon view, list view, and details view would be the program known as "File Explorer" (Windows) or "Finder" (Mac). This program uses all the views to make selecting and tracking down certain files a much more painless and easier process to complete.

Explanation:

boom : )

Answer: Maybe C

Explanation:

You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Which of the following can you drag on your spreadsheet to do this?

Answers

How can you insert a new row into your data without disturbing an adjacent set of data on the same sheet? Highlight only the data where you'd like to insert a row. Right-click > Insert > Shift cells down.

Identify the parts of a spreadsheet by using the drop-down menus to select the part that corresponds to the labeled diagram to the right.

A

B

C

D

E

Answers

I believe d is the answer !

Answer:

A- Row

B- Column

C- Workbook

D- Cell

E- Sheet

Explanation:

Got a 100% on this, the person above is incorrect.

Write code which takes inputs and creates two Rectangle objects (using the edhesive.shapes.Rectangle class) and compares them using the equals method.

JAVA!!

Answers

Answer:

System.out.println("Enter length:");

Scanner scan = new Scanner(System.in);

Double x = scan.nextDouble();

System.out.println("Enter 2 lengths:");

Double a = scan.nextDouble();

Double b = scan.nextDouble();

Rectangle rect = new Rectangle(x);

Rectangle rect2 = new Rectangle (a,b);

if (rect2.equals(rect)){

 System.out.print("Congruent Rectangles");

}

else {

 System.out.print("Different Rectangles");

}

 }

}

Explanation:

Create a for-loop which simplifies the following code segment: penUp(); moveTo(100,120); turnTo(180); penDown(); moveForward(25); penUp(); moveTo(100,120); turnTo(180); penDown(); moveForward(25); penUp(); moveTo(100,120); turnTo(180); penDown(); moveForward(25);

Answers

Answer:

for(var i=0; i<3; i++) {

  penUp();

  moveTo(100,120);

  turnTo(180);

  penDown();

  moveForward(25);

}

Explanation:

The i variable is the loop dummy. The code block will be executed 3 times.

What are the lines of communication on a motherboard?

Answers

Answer:

buslines

Explanation:

hybfndndndjdkd

How do information systems help organizations?

Answers

Answer:

Information systems assist in disseminating information by allowing managers and other organization leaders to store data in folders and documents that can be seamlessly shared with the appropriate employees.

Explanation:

PLEZ ANSWER QUICK
Another name for a web page's address is _____.

ISP

web server

HTTP

URL

Answers

The answer is URL. ........

Answer:

URL is the other name for a web page's address

8.6 Code Practice: Question 1
Write a function named buildArray that builds an array by appending a given number of random two-digit integers (10-99). It should accept two parameters — the first parameter is the array, and the second is an integer for how many random values to add, which should be input by the user.

Print the array after calling buildArray

Answers

In python 3.8:

import random

def buildArray(arr, nums):

   i = 0

   while i < nums:

       arr.append(random.randint(10,99))

       i+=1

arr = []

numbers = int(input("How many values to add to the array:\n"))

buildArray(arr, numbers)

print(arr)

I hope this helps!

The function named buildArray that builds an array by appending a given number of random two-digit integers (10-99) and accept 2 parameters is represented below

import random  

def buildArray(array, integer):

   i = 0

   while i < integer:

       array.append(random.randint(10, 99))

       i += 1

   return array

print(buildArray([], 12))

The code is written in python.

A function is declared called buildArray. This function accept 2 parameters which are arrays and integer.

i is use to declare a variable assigned to zero.

while i is less than the integer(one of the parameter), random number between 10 and 99 is appended to the parameter array.

The value of i keeps on increasing until it becomes less than the integer.

The filled array is returned.

Finally, we call the function with the required parameters.

The bolded portion of the code are keywords in python.  

read more: https://brainly.com/question/18612252?referrer=searchResults

HURRY IM TIMED the ability for search engines to return search results in relevancy ranking in an evolving capability true or false

Answers

Answer:

The answer is True

Explanation:

I took the quiz and got it right.

Hi, I couldn't delete my questions so I'm just editing them so you don't have to do it.

Answers

Ok that got h in by going go off do us do

Write the count below the rests.

How do I do I do this?
Help guys

Answers

Well 1234 for the first one

What is the output of the following code:
lang=
['Python','C','C++, JAVA,ASP'PHP',VB', Oracle
'MySQL)
list1 = lang(2:-2]
list2 = langl-2:-5)
list3 = langl: : 3]
print(list)
print(list)
print(list3)​

Answers

Answer:

Syntax error.

Explanation:

There are many typing mistakes in this source code.

Jon wants to set up a trihomed DMZ. Which is the best method to do so? A. use dual firewalls B. use a single firewall with only two interfaces C. use a single three-legged firewall with three interfaces D. use dual firewalls with three interfaces

Answers

Answer:

The correct option is C) Use a single three-legged firewall with three interfaces

Explanation:

DMZ is an acronym for a demilitarized zone.

A DMZ network is one is situated between the internal network and the Internet. It is supported by an Internet Security and Acceleration (ISA) server.

The interfaces you'd get with the DMZ network are

A public network (Internet Protocol-IP) address  with a public interfaceAn internal network interface with a private network (IP) address  A DMZ interface with a public network (IP) address  

Unlike the back-to-back DMZ settings, a trihomed DMZ is unable to use private IP addresses. To use the trihomed DMZ, public IP addresses are a must suitable requirement.

Cheers!

i need help with the rest also

Answers

Answer:

??? blackkkkkkkkkkkkkkkkk

Other Questions
Alfonso makes eight dollars per hour working at a movie theater and $12 per hour working at a restaurant next week a council is scheduled to work six hours at the movie theater which of the following inequalities represent the amount of hours that Alfonso needs to work at the restaurant next week to earn at least $144 between those two jobs What does complete awareness of an object refer to?A. spaceB. perceptionC. line Use binomial expansion to solve each exercise. (a) Find the coefficient of xy19 in (3x 2y) 20.(b) Give a formula for the coefficient of x k in (x+1/ x) n . 4 A baby's t-shirt requires 5 yards of fabric. How many t-shirts can be made from 48 yards? Luna finds a plant in the forest and is curious about the type of plant she is viewing. She notices the plant has a woody stem and is about a foot taller than she is. Based on this description alone, what is most likely true about this species? Which of the following statements about elements and atoms is true?Atoms are the smallest unit of an element.Atoms are made of particles called elements.Elements are made of more than one type of atom.Elements are changed into atoms by a chemical reaction. list three people who you think are being role models or admirable why cottin is lighter than iron Who was George whitefeild and what did he do? 13. Jason is collecting rainwater in buckets.ABC Buckets A, B and C are the same size.2Bucket A is3full.3Bucket B is4full.5Bucket C is6full.Is there enough rainwater in bucket C to pour into bucket A and B to fill them The ratio of males to total students in a mathematics class is 12 to 30. What percent of the class is female? 40% 60% 30% 12% Juans business had sales in August of $3,256.00. In the same month, his expenses were $4,000.00. Juans profit for the month is ? Can i get the common lit answers to AMERICAN INDIAN SCHOOL A FAR CRY FROM THE PAST What is the answer to the question below?Will get awarded with brainliest answer.Today, land in urban areas typically is used for housing, transportation, and other structures, rather than for agriculture, primarily due to __________.A.advancements being made in irrigation techniquesB.fewer Americans engaging in agricultureC.people relying more on other areas of the economyD.transportation time and shipping costs being reducedPlease select the best answer from the choices provided. Branliest to right answer Why are the Louisiana constitution and the United States Constitution considered "living documents? HELP ASAP They act in the interest of the people.They can be amended with additions.They protect the rights of living citizens.They outline the powers of representatives. We the people of the United States, in Order to form a more perfect Union. . . What was the purpose of the introduction that begins with these words? to explain the reasons for the writing of the Constitution to explain the reasons for including the Bill of Rights in the Constitution to explain the reasons for including the amendment process in the Constitution to explain the reasons for writing the Declaration of Independence before the Constitution What caused inflation to occur in many states? What are the common characteristics among acidic compounds? Basic? hellppp I'm slowee don't know anything