Question: Write an application called UsernameGenerator that takes input from several questions and provides the user with a list of two possible generated usernames. The user

Write an application called UsernameGenerator that takes input from several questions and provides the user with a list of two possible generated usernames. The user cant come up with a unique username to use to create a new account, so your program will generate some possible values for them. Your code should work with any valid input values.

Input: Your code will prompt and save the following inputs from the user:

First Name Assume the first name is one word String with at least 3 letters. Use your first name.

Last Name Assume the last name is one word String with at least 3 letters. Use your last name.

Birth Year Assume four-digit birth year. Can use String.

Output: Your code will generate and display the following two usernames and their lengths (number of characters):

1st Username Generated Formula: [2nd character of first name] + "$"+ [last two digits of birth year] + [full last name in all uppercase] + [random number 1-100]

2nd Username Generated Formula: [1st two characters of first name] + [length of the first name] + "$" + [last 2 characters of last name] + [random number 50-75]

Helpful methods to consider:

Scanner class methods: nextLine for reading in Strings

String class methods: substring, charAt, length, toUpperCase

Random class method: nextInt

Hint: The length() method is helpful in finding the index for the last two characters of a String.

Example output : Of course your output results will be different, but the format should be the same.

Welcome. This program will help you create a username. Enter your first name: Luke Enter your last name: Skywalker Enter your birth year: 1987

Here are the two possible usernames generated for you: Username1: u$87SKYWALKER59 Length: 15 Username2: Lu4$er72 Length: 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!