Oct-11-2017, 02:12 PM
Would anyone be able to help me out with this question I have been set, I am very new to Python and do not know much about arrays however I know that Python uses lists instead. I just do not know how to apply them to this question at all and where I would start, I would really appreciate if someone would break down the steps into approaching this question so I can attempt to answer it myself with the steps you provided, thank you very much. Here is the question:
A printing company uses a computer program to randomly generate and print bingo tickets. Each bingo ticket has a grid with three rows and nine columns. Each row contains 5 numbers and 4 blank spaces. The computer program stores the numbers in a 2-dimensional array called Ticket. In the array Ticket, the first index represents the row and the second represents the column. e.g. Ticket(1,4) = 32 means the number on row 1, column 4 is 32.
To generate the tickets, the computer program first fills in the columns with random integers. After filling the array, the computer program ensures that no numbers have been repeated, and replaces four positions on each row with the number 0.
A bingo ticket is printed using the following method.
For every row in the array
For every column in that row
— If the value is o then output a space
— otherwise output the value
Write an algorithm to print the numbers in the array onto a ticket. You should indent your code correctly to make it easier to understand.
Thank you,
-Oli
A printing company uses a computer program to randomly generate and print bingo tickets. Each bingo ticket has a grid with three rows and nine columns. Each row contains 5 numbers and 4 blank spaces. The computer program stores the numbers in a 2-dimensional array called Ticket. In the array Ticket, the first index represents the row and the second represents the column. e.g. Ticket(1,4) = 32 means the number on row 1, column 4 is 32.
To generate the tickets, the computer program first fills in the columns with random integers. After filling the array, the computer program ensures that no numbers have been repeated, and replaces four positions on each row with the number 0.
A bingo ticket is printed using the following method.
For every row in the array
For every column in that row
— If the value is o then output a space
— otherwise output the value
Write an algorithm to print the numbers in the array onto a ticket. You should indent your code correctly to make it easier to understand.
Thank you,
-Oli