Question: Problem 1: Dynamic Grocery Array Using Java to write a program that prompts the user to enter an items name for each position in the

Problem 1: Dynamic Grocery Array

Using Java to write a program that prompts the user to enter an items name for each position in the array. The program then prints uses a loop to output the array.

Example

1: Banana 2: Orange 3: Milk 4: Carrot 5: Chips Banana, Orange, Milk, Carrot, Chips

Problem 2: Print Characters in String Array

Declare a string array of size 5. Prompt the user enters five strings that are stored in the array. Using Java to write a function that prints a string in a reverse order. The function must use loop to reverse a string. Call that function from the main and output the value.

Hint: An array of string is like working with multi-dimensional array.

Example

Enter five items. Item 1: hello Item 2: C++ Item 3: Wednesday Item 4: Its a great day Item 5: goodbyeReverse strings: Item 1: olleh Item 2: ++C Item 3: yadsendeW Item 4: yad taerg a stI Item 5: eybdoog

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!