Question: How do i read fractions off a string input in java? i want the user to input a string of fractions say 13/3 3/2 3/8

How do i read fractions off a string input in java?

i want the user to input a string of fractions say

\"13/3 3/2 3/8 12/5 4/5\"

i want to read these fractions and store them into an array int if possible, and get the total count of fractions inputed.

in this case count = 5

array[0] = 13/3

or array[0] =13 array[1]=/ array[2] =3

i'm not sure.. i'm kinda lost..

please show me in code

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 Programming Questions!