{"action":"created","issue":{"url":"https://api.github.com/repos/mamashe/sheila-java-learning/issues/41","labels_url":"https://api.github.com/repos/mamashe/sheila-java-learning/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/mamashe/sheila-java-learning/issues/41/comments","events_url":"https://api.github.com/repos/mamashe/sheila-java-learning/issues/41/events","html_url":"https://github.com/mamashe/sheila-java-learning/issues/41","id":97360103,"number":41,"title":"Write an app that creates random numbers in the range 5 - 50","user":{"login":"lcabrini","id":98929,"avatar_url":"https://avatars.githubusercontent.com/u/98929?v=3","gravatar_id":"","url":"https://api.github.com/users/lcabrini","html_url":"https://github.com/lcabrini","followers_url":"https://api.github.com/users/lcabrini/followers","following_url":"https://api.github.com/users/lcabrini/following{/other_user}","gists_url":"https://api.github.com/users/lcabrini/gists{/gist_id}","starred_url":"https://api.github.com/users/lcabrini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcabrini/subscriptions","organizations_url":"https://api.github.com/users/lcabrini/orgs","repos_url":"https://api.github.com/users/lcabrini/repos","events_url":"https://api.github.com/users/lcabrini/events{/privacy}","received_events_url":"https://api.github.com/users/lcabrini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-26T23:58:04Z","updated_at":"2015-08-10T10:38:18Z","closed_at":null,"body":"Create a program that generates 10000 numbers in the range 5 to 50. Don't print the numbers out, but keep two counter minValue and maxValue that should hold the lowest and the highest numbers generated. Each time you generate a random number, if it is lower than the current value of minValue, update minValue. If the newly generated number is greater than maxValue, update maxValue. \r\n\r\nWhat values do you have to initialize minValue and maxValue to in order for the simulation to work? Why do you need to set these values?\r\n\r\nRun the program a few times to ensure that each time minValue is 5 and maxValue is 50. What happens if you lower the number of iterations (that is, the number of random numbers being generated)? What if for example, you set it to 10 instead? Will you still get minValue at 5 and maxValue at 50? Explain.\r\n\r\nCreate a Wiki page called Random numbers. Document your findings there. Include an explanation of pseudo-random numbers, an explanation to how to generate random numbers from 5 to 50.\r\n\r\nPlace you code in a folder called randrange."},"comment":{"url":"https://api.github.com/repos/mamashe/sheila-java-learning/issues/comments/129403165","html_url":"https://github.com/mamashe/sheila-java-learning/issues/41#issuecomment-129403165","issue_url":"https://api.github.com/repos/mamashe/sheila-java-learning/issues/41","id":129403165,"user":{"login":"mamashe","id":12872034,"avatar_url":"https://avatars.githubusercontent.com/u/12872034?v=3","gravatar_id":"","url":"https://api.github.com/users/mamashe","html_url":"https://github.com/mamashe","followers_url":"https://api.github.com/users/mamashe/followers","following_url":"https://api.github.com/users/mamashe/following{/other_user}","gists_url":"https://api.github.com/users/mamashe/gists{/gist_id}","starred_url":"https://api.github.com/users/mamashe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamashe/subscriptions","organizations_url":"https://api.github.com/users/mamashe/orgs","repos_url":"https://api.github.com/users/mamashe/repos","events_url":"https://api.github.com/users/mamashe/events{/privacy}","received_events_url":"https://api.github.com/users/mamashe/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T10:38:18Z","updated_at":"2015-08-10T10:38:18Z","body":"Hi Lorenzo, i have committed this issue without closing because i am not done with the code yet. I have some challenges and need your assistance. I initialize the \r\n    int minValue = 0;\r\n    int maxValue = 0;\r\n\r\n    if(range <= 5){\r\n          minValue++;\r\n     } else if(range >= 50){\r\n             minValue++;\r\n        }\r\nbut when i run the code i always get minValue 0, so i change and initialize minValue = 5; maxValue = 50; but when you run the program, the minValue is higher than 5;\r\n\r\nI need your advise.\r\n"}}