Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question covers materials up to Seminar 4. The data structure to use is List. Do not use nested list, set or dictionary for this
This question covers materials up to Seminar 4. The data structure to use is List. Do not use nested list, set or dictionary for this question. Keep the program modular by defining other functions if necessary. Read the entire question before attempting. You need to submit each part individually. a) TOTO is a legalised form of lottery sold in Singapore. To play TOTO, the buyer selects 6 numbers from 1 to 49 by marking them on a bet slip. Write the following functions: ticket V alidator(numbers: list): boolean - This function returns True if SINGAPORE UNIVERSITY OF SOCIAL SCIENCES (SUSS) Page 4 of 14 ICT133 Tutor-Marked Assignment the given numbers (in a list) are all unique all numbers are within 1 to 49 - Otherwise, return False. - For example, ticket V alidator ([5,47,6,32,49]) returns True ticket Validator ([5,6,7,6,45,31]) returns False ticket Validator ([51,6,7]) returns False (7 marks) b) Another way to place a bet is through "QuickPick", where the computer randomly selects 6 unique numbers for the buyer. Write the following function: quickPick( ): list use of the ticket V alidator() function in part (a), where possible. (7 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started