farrukh nadeem wrote:Your observation about 'j' corrected.
Current problems are array reads 4 values only NOT 4 distinct values, output is all ZEROS.
farrukh nadeem wrote:an array, where duplicates are rejected
farrukh nadeem wrote:Yes, I know somewhat about SET. Actually, I want to know if I could do it in ARRAY just to get solid understanding of looping.
Winston Gutkowski wrote:Perfectly reasonable. However, your inner loop will still run forever, AFAICS. See if you can work out why.
Regarding fred rosenberger's suggestion of Decomposition
farrukh nadeem wrote:Sorry, I failed to catch your Big Hint: Don't know why the inner loop is asking inputs whereas nextInt code is outside of inner loop. Give me another hint
farrukh nadeem wrote:I got the culprit....should be replaced with
farrukh nadeem wrote:The code is still not fully functional.
farrukh nadeem wrote:Code has been decomposed as follows although not functioning:
farrukh nadeem wrote:Stuck at coding and closed IDE..... probably I should go to learning table again.... would you suggest something I could learn Java systemically ?
farrukh nadeem wrote:I looks I hurt you people out there. I regret I did not meant it.
Actually, I am serious in what I asked in mt previous post, because I am not CS literate and learning at home by working on various book examples.
I feel I always deviate from Winston's advice of WHATnotHOW, my mind always jumps ahead to code the problem, instead of tearing down the problem and make logic of every step to code it.
So, I thought I should learn the "best coding practice" first by following resources available on internet.