"Keith Teo" <ksteo1@singnet.com.sg> wrote:
>
>"angel" <eneg@jps.net> wrote:
>>
>>with an array called "fraction" of type float, what would be the code needed
>>to assign the value 1.667 to array element9 and the value to array3.333

>to
>>array element 7.
>>
>>thank you

>
>Assuming you have an array named fraction of type float, so..
>float []fraction;
>And that you have a total of 9 elements in your array, so..
>fraction= new float[8];
>Remember, float[0] also counts as a element, java array starts indexing

from
>0.
>so to assign 1.667 to element 9.. u do this..
>fraction[8]=1.667;
>and to assign 3.333 to element 7.. u do this..
>fraction[6]=3.333
>
>so code fragment is actually as follows..
>
>float []fraction=new float[8];
>fraction[8]=1.667;
>fraction[6]=3.333;
>
>nbls reply to my email if you need clarifications.
>
>
>

thanks so much for the help.