EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
Question
Book Icon
Chapter 7, Problem 4PE
Program Plan Intro

Program to display valid and invalid password

Program plan:

Filename: “ValidatePassword.java”

  • Define the “ValidatePassword” class
    • Declare the required variables and set the values.
    • Create an object for scanner class.
    • Prompt the user to enter the password.
    • Read the length of the string and store it in a variable.
    • Using, if…else condition check whether the string contains two uppercase, 3 lowercase and one digit.
    • If the condition is satisfied, print the string as valid password, else print as invalid password.

Blurred answer
Students have asked these similar questions
Write an application named, Lab14.java. This application will do the following: 1. Display an introductory message 2. Choose a random word from the file, wordlist.txt, and display it 3. Disguise the selected word, and display it 4. Ask the user whether to continue, i.e., whether to repeat steps 2, 3, and 4, or quit the application Once the user chooses to stop the application: 5. Display the total number of vowels hidden 6. Display the total number of consonants hidden 7. Display termination message The user will be asked whether to continue playing and will indicate that another game is to be played by answering ‘y’ or ‘Y’ in response to the question, “Want to play again?” asked by the program after displaying each chosen word and its disguised version. If the user’s response is any character other than ‘y’ or ‘Y’, the totals are displayed and then the application termination message is displayed. See examples below. About randomly choosing a word from the file, wordlist.txt, found on…
Write an application that handles a student report card. The application shall save the marks of computer science, math and English. Each subject has a total of 50 marks. If a student obtains at least 75/150 marks, an event will trigger and show a congratulation message on passing the exam. Otherwise, it will display an “F” grade.
For Java Write an application that prompts the user for a password that contains at least two uppercase letters, at least three lowercase letters, and at least one digit. Continuously reprompt the user until a valid password is entered. Display Valid password if the password is valid; if not, display the appropriate reason(s) the password is not valid as follows: The password did not have enough of the following: uppercase letters lowercase letters digits
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,