password java ??????????

Oct 19th, 2014
Steve1995
Category:
Programming
Price: $45 USD

Question description

 (Check password) Some websites impose certain rules for passwords. Write a method  that checks whether  a string  is a valid password. Suppose  the password rules are as follows:

A password must have at least eight characters .
A password consists of only letters and digits.
A password must contain at least two digits.

Write a program  that prompts the user to enter a password and displays Valid Password if the rules are followed or Invalid Password otherwise.


SAMPLE RUN #1

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

22HelloWorld 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Valid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: 22HelloWorld 
Valid Password

SAMPLE RUN #2

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

dd89 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: dd89 
Invalid Password

SAMPLE RUN #3

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

Police999Knights! 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: Police999Knights! 
Invalid Password

SAMPLE RUN #4

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

2HelloBermuda8 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Valid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: 2HelloBermuda8 
Valid Password

SAMPLE RUN #5

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

2 Lobster88Mash 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: 2 Lobster88Mash 
Invalid Password

SAMPLE RUN #6

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

22HHjj 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: 22HHjj 
Invalid Password

SAMPLE RUN #7

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

Lothar8Magnificient 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: Lothar8Magnificient 
Invalid Password

SAMPLE RUN #8

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

8Happy!D@ys22 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: 8Happy!D@ys22 
Invalid Password

SAMPLE RUN #9

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

Happy66Nights 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Valid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: Happy66Nights 
Valid Password

SAMPLE RUN #10

--- Prompts For Keyboard/Console/Standard Input ---

Enter a password:

Inputs

--- Keyboard/Console/Standard Input stdin ---

Happy6Nights 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a password:Invalid Password

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java CheckPassword 
Enter a password: Happy6Nights 
Invalid Password


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Purdue University
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
pmallory
Dec 4th, 2016
" Totally impressed with results!! :-) "
mixedballz
Nov 25th, 2016
" excellent work as always thanks for the help "
Five Star Tutor
Nov 23rd, 2016
" Outstanding Job!!!! "
kiln82
Nov 11th, 2016
" awesome work thanks "
darnay
Nov 2nd, 2016
" The best tutor out there!!!! "
likeplum4
Oct 29th, 2016
" Excellent work as usual "
kpcutie
Oct 6th, 2016
" Excellent job "
Joemoe
Sep 27th, 2016
" <3 it, thanks for saving me time. "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1826 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors