There are 3 levels and under each level there will be 5 questions. Based on the level number which will be passed as a parameter we have to read the questions. There will be a file which comprises of all 15 questions of which first 5 belongs to level 1 and next 5 belongs to level 2 and the last 5 belongs to level 3. We have to read the questions for a specific level and they must be stored in an arraylist. Can anyone help me in solving this problem using Java? If possible write the code also.
Vallabhaneni,I'm afraid you posted the right question in the wrong forum... There are Java in General forums to post such kind of questions... It will be more likely to be replied, if you post your questions in the proper forum... Just my 2 cents...
The directly reach that question of a particular level if level starts from 1 then 5*(level-1)+1; so if question are from 1 to 15 ;for level 1 question starts from 1 and for level 2 question start from 6 and level 3 starts from 11. to add question to array list use for loop from 1 and ending at i<=5. I think this would solve your problem