Question: I have a java question. Our teachers wants us to solve a question by using strings. The user enters fruits and numbers and the output

I have a java question. Our teachers wants us to solve a question by using strings. The user enters fruits and numbers and the output will be like this. All of them have 4 spaces between the next one. When the user enters negative numbers it will stop. Please help me as soon as possible. I don't have much time !!!!! And dont use objects and array please.

Teacher gave us a hint

Hint:nested loops will be used for this problem. You should store the result as string, then print it string to show up. You are not allowed to store the numbers read from the user; simply process each one as it is read!

Please enter: apple 3 banana 4 kiwi 0 peanut 2 apple -3

apple apple apple

banana banana banana

peanut peanut

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!