I am stuck in the following problem from a long time –
I want to create a String array StrTime from 3 Int arrays.
Input Arrays
int Time1[]={"1.1","2.1","4.1"};
int Time2[]={"2.5","4.7","5.1"};
int Time3[]={"12.55","1.11","2.1"};
CurrentTime = 2.0;
So loop though each integer array, check Time1, the first array item which is greater than 2.0 should be put in our String array, Noe check Time2 for the same and Time3.
At end we should get output String array as –
Output Array
String strTime[] ={"2.1","None","2.1"}
Can someone help me????
UPDATE:
Also is there a way to create a double [] like below-\
{1,2,,3,4,,5}
May be a typo, but that’s the way to init the arrays (they should be
double):Hints:
Stringarray for the resultfor-loop through the first arrayifthe current value is greater then store it in the first slot of the string array (need to convert it to string), andbreakout of the loop.