i need to design a program that generates a 7 digit lotterynumber. the program s
ID: 3614432 • Letter: I
Question
i need to design a program that generates a 7 digit lotterynumber. the program should have an integerarray with 7 elements. then i must write a loop that stepsthrough the array, randomly generating a number in the range of 0thruogh 9 for each element. i have to use therandom function to do this. then i mustwrite another loop that displays the contents of the array. i am really having trouble with randomly generating a numberfor each of the elements. please help i need to design a program that generates a 7 digit lotterynumber. the program should have an integerarray with 7 elements. then i must write a loop that stepsthrough the array, randomly generating a number in the range of 0thruogh 9 for each element. i have to use therandom function to do this. then i mustwrite another loop that displays the contents of the array. i am really having trouble with randomly generating a numberfor each of the elements. please helpExplanation / Answer
Not sure if this is exactly what you need, but it may behelpful Dim i As Integer, LotteryNumber As Integer, LotteryArray(7) AsInteger, RandNumGenerator i = 0 RandNumGenerator = NewRandom Do While (i < 7) LotteryNumber = RandNumGenerator.Next(maxValue:=9) i += 1 LotteryArray(i) = LotteryNumber Loop i = 0 Do While(iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.