Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Once I was attended a test on java programing at my college. Well what was my challenge was get a input from the user.

The input type: 100|30.2|20.2

I was failed to get the input.

Could you anyone help me guys? :)

What I have tried:

I tried to get those input in array format like looping trough the array bt it was failure:(
Posted
Updated 30-Jun-22 5:48am

1 solution

If you do not know how to get the input, it is always best to discuss this with your teacher. The teacher should know when a student is facing any challenges.

We can definitely tell you how to capture the input, how to parse it, and maybe how to distribute or print it. But, we might not know what your teacher would expect next from you.

Scanner (Java Platform SE 8 )[^]

Secondly, based on your question it is not clear if the input has to be of this format, do we need to parse the data in variables, keep it in a single String type, or what.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900