Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

plz use java Assume we have already defined a variable of type String called password with the following line of code: String password = ???;

plz use java image text in transcribed
Assume we have already defined a variable of type String called password with the following line of code: String password = "???"; 11 'password' can have any String value However, because of increased security mandated by UCSD's technical support team, we need to verify that password is secure enough. Specifically, assume that a given password must have all of the following properties to be considered "secure": It must be at least 7 characters long It must have characters from at least 3 of the following 4 categories: Uppercase (A-Z), Lowercase (a-z), Digits (0-9), and Symbols TASK: If password is secure, print 'secure"; otherwise, print "insecure'. HINT: You can assume that any char that is not a letter (A-Z, a-2) and is not a digit (0-9) is a symbol. EXAMPLE: 'UCSDcse11' would be valid because it is at least 7 characters long (it's 9 characters long), it has at least one uppercase letter (U', 'C', 'S', and 'D'), it has at least one lowercase letter (c', 's', and 'e'), and it has at least one digit (1' and '1'). EXAMPLE: "UCSanDiego' would be invalid because, while it is 10 characters long, it only has uppercase and lowercase letters, so it only has characters from 2 of the 4 categories listed. Sample Input: UCSDcse11 Sample Output: secure

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions