Question: Arrays Lab Create a class called CustomerListerArray with a main method that declares and instantiates an array of Stringobjects called customerName. The array should have

 Arrays Lab Create a class called CustomerListerArray with a main method

Arrays Lab Create a class called CustomerListerArray with a main method that declares and instantiates an array of Stringobjects called customerName. The array should have room for seven String objects. Assign each of the following Strings to sequential locations in the array 1 beginning at array index 0. Do not use an array initializer list to create the customerName array 0 Beth Jerry 2Rick 3 Summer 4Morty Write a for each loop to print the array of names to the console. Each name MUST be on a separate line. (After printing the contents of the array, print a blank new line for formatting) In the comments text box in the Blackboard assignment link answer the following questions: 1. What is displayed for the last two array elements? 2. Why is it that value? Move the existing elements from indexes 3 and 4 so that you can add the Strings "Jerry" and "Jessica" into index 3, and 4, respectively, and the array contains the following elements in this order: 0 Beth 0 Beth 1 Je 2 Rick Jerry 2 Rick 3 Je 4 Jessica 5 Summer 4 5 Summer 6 Morty 6 Morty Write another for each loop to print the array of names to the console. Again, each name MUST be on a separate line. (After printing the contents of the array, print a blank new line for formatting) Write a second, traditional for loop that checks each element for the String "Jerry", if found in the array, remove it, shift the remaining elements up, and print the array of names to the console in the same manner as the rest of the lab. In the comments text box for your Blackboard submission, answer the question: Are both instances of "Jerry" removed correctly from the array? Why or why not? In other words, explain what you observe in your code. 3. 4. 2 Upload your file CustomerListerArray.java to the assignment link in Blackboard

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!