Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions