Question: I need help creating a method the satisfies the following requirements using java. o The identifier field will be created using the first 7 letters

I need help creating a method the satisfies the following requirements using java.

o The identifier field will be created using the first 7 letters (uppercased) of the last name.

If the last name has less than 7 letters, the code should append Xs to the end of the name, so that there will be 7 letters total.

o The code in the body of method will:

Declare an integer constant to hold an id length of 7.

Declare a second String constant to hold seven Xs ("XXXXXXX").

Use decisions with these constants and the last name to create the drinker identifier, WITHOUT using brute force.

o NOTE: You will need to check the length of the last name BEFORE trying to extract any letters, and then use a decision statement to decide which letters to extract. Otherwise the program may crash when there are less than 7 letters in the last name.

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!