Sample output: Please enter Member Number: 0100 Press ENTER to start your lucky draw! Your lucky number is 16 You WIN the Prize of Cash Voucher RM 50 Do you want to continue? yes Please enter Member Number: 0099 Press ENTER to start your lucky draw! Your lucky number is 66 You WIN the Prize of Relaxing Spa Treatment for 2 Do you want to continue? yes Please enter Member Number: 0063 Press ENTER to start your lucky draw! Your lucky number is 81 You WIN the Prize of Cash Voucher RM 50 Do you want to continue? no

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

##Please help with this practice programming problem.....

##if you can't answer the whole problem, please at least try helping with the file handling part thank you

02. (Continued)
Sample output:
Please enter Member Number: 0100
Press ENTER to start your lucky draw!
Your lucky number is 16
You WIN the Prize of Cash Voucher RM 50
Do you want to continue? yes
Please enter Member Number: 0099
Press ENTER to start your lucky draw!
Your lucky number is 66
You WIN the Prize of Relaxing Spa Treatment for 2
Do you want to continue? yes
Please enter Member Number: 0063
Press ENTER to start your lucky draw!
Your lucky number is 81
You WIN the Prize of Cash Voucher RM 50
Do you want to continue? no
Note: Assume all inputs are correct. Only techniques/methods/codes learned in the
course such as if-else, while loop, for loop, list, textfile and others are allowed in this
program. It is optional/not compulsory to apply self- or user-definedfunction.
Latest text file draw library.txt:
1
1
2
2
98
Transcribed Image Text:02. (Continued) Sample output: Please enter Member Number: 0100 Press ENTER to start your lucky draw! Your lucky number is 16 You WIN the Prize of Cash Voucher RM 50 Do you want to continue? yes Please enter Member Number: 0099 Press ENTER to start your lucky draw! Your lucky number is 66 You WIN the Prize of Relaxing Spa Treatment for 2 Do you want to continue? yes Please enter Member Number: 0063 Press ENTER to start your lucky draw! Your lucky number is 81 You WIN the Prize of Cash Voucher RM 50 Do you want to continue? no Note: Assume all inputs are correct. Only techniques/methods/codes learned in the course such as if-else, while loop, for loop, list, textfile and others are allowed in this program. It is optional/not compulsory to apply self- or user-definedfunction. Latest text file draw library.txt: 1 1 2 2 98
4
Practice Question 2 (Using Python)
Write a COMPLETE PYTHON PROGRAM for Jenny who wishes to give a surprise
lucky draw for the members of her travel agency. She has listed out the gifts, number
of units, and the lucky number for each gift as listed in Table 2.1. Each lucky draw
number can only be drawn once, and the umbers are from 1- 109. The unit of each
gift will be reduced accordingly after each win.
Q2.
Table 2.1
Gift
Unit
Luckv Number(s)
2 Night Hotel Stay for 2
Relaxing Spa Treatment for 2
Theme Park Entry Ticket for 2
1 unit Rice Cooker
1 unit Juice Blender
1
99
2
88 66
2
33,22
2
77, 55
2
11, 44
Cash Voucher RM 50
100
Other than the above
This program should read the number ofunits from the text file draw library.txt. At the
end ofthe program, the text file should save the latest unit of each gift after the lucky
draw. The original text file draw library.txt, sample output, and latest text file
draw library.txt after the lucky draw are shown below.
Original text file draw library.txt:
1
2
2
2
100
Transcribed Image Text:4 Practice Question 2 (Using Python) Write a COMPLETE PYTHON PROGRAM for Jenny who wishes to give a surprise lucky draw for the members of her travel agency. She has listed out the gifts, number of units, and the lucky number for each gift as listed in Table 2.1. Each lucky draw number can only be drawn once, and the umbers are from 1- 109. The unit of each gift will be reduced accordingly after each win. Q2. Table 2.1 Gift Unit Luckv Number(s) 2 Night Hotel Stay for 2 Relaxing Spa Treatment for 2 Theme Park Entry Ticket for 2 1 unit Rice Cooker 1 unit Juice Blender 1 99 2 88 66 2 33,22 2 77, 55 2 11, 44 Cash Voucher RM 50 100 Other than the above This program should read the number ofunits from the text file draw library.txt. At the end ofthe program, the text file should save the latest unit of each gift after the lucky draw. The original text file draw library.txt, sample output, and latest text file draw library.txt after the lucky draw are shown below. Original text file draw library.txt: 1 2 2 2 100
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY