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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started