Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program to create a new user ID that meets all of the following requirements. 1 ) Ask user to input a new

Write a Java program to create a new user ID that meets all of the following requirements.
1) Ask user to input a new user ID.
2) The following checks must be made against an attempt to create a new user ID.
ID must be between 5 and 10 characters in length. ( length >=5 and <=10)
ID must start with a letter like [a-z A-Z]
ID must have at least TWO numbers.
ID must have at least one special character. (tip: If a character is neither a letter nor a number, it is considered a special character).
The first character and the last character of the ID must NOT be the same.
3) If the rules are violated, the user ID and error message should be displayed (see example below), and ask user to input new ID again.
4) When a valid use ID is provided, this user ID and appropriate message should be displayed, and your program stops. (see example below)
Requirements:
Six methods must be implemented. (main method, a method to check the length, a method to check letter, a method to check number, a method to check special character, and a method to check first/last character.
You must apply the concept of 'method-calling-method', 'parameter passing', and 'method that return values'.
You must apply the concept of good 'boolean zen',
*** MUST include
at least one space line before and after each while loop and for loop (if any).
at least one space line before if statement. At least one space line between each method
proper indentation
Your name and comments necessary to explain the operation of your program.
Sample log: (user inputs are in bold and underlined)
Input new ID: cs210
cs210 is invalid.
Input new ID: aba1
aba1 is invalid.
Input new ID: abc21021av
abc21021av is invalid.
Input new ID: 1ab2101
1ab2101 is invalid.
Input new ID: abc210a
abc210a is invalid.
Input new ID: abc?210a
abc?210a is invalid.
Input new ID: abc?2abc
abc?2abc is invalid.
Input new ID: abc?210y
Congratulations! abc?210y is created successfully.

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

Question

1. What are your creative strengths?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago