Question: Create a project that asks the user to enter a String . Once you have that String value, create an array of characters that has

Create a project that asks the user to enter a String. Once you have that String value, create an array of characters that has the same size as the entered String. Loop through the String and save each individual character into each element of the created array.

For example: If the user enters hello world the array would be of size 11 (it would have 11 elements):

Array:

Index 0 1 2 3 4 5 6 7 8 9 10
Element 'h' 'e' 'l' 'l' 'o' ' ' 'w' 'o' 'r' 'l' 'd'

Notice how even the space is counted as an individual element. That's because it counts as an individual character in the String.

After the array has been created, you will be displaying it back to the user in two ways:

1. Use a for loop to iterate through and display each element of the character array. 2. Use the following code snippet: System.out.println(Arrays.toString(arrayName)); For this method, replace arrayName with the actual name of your character array. You will also need to import java.util.Arrays;

Don't forget to test your program throughout the coding process!

Repeat this process by allowing the user to keep entering new Strings, until they enter "exit" to quit. Once the user enters exit, stop iterating through the loop and display a goodbye message.

make sure to use java

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!