Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

1. Does the survey prompt discussions with your direct reports?

Answered: 1 week ago