Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 Lucky Draw (9% Pong Pong Shopping Mall is having their weekly lucky draw contest. 5 shoppers are chosen from a pool of lucky draw

image text in transcribedimage text in transcribed

3 Lucky Draw (9% Pong Pong Shopping Mall is having their weekly lucky draw contest. 5 shoppers are chosen from a pool of lucky draw forms at the information counter. These shoppers will form a queue. The shopping mall host will call the shoppers based on the queue and ask them a question. These shoppers will be given a $100 voucher if they have answered the question correctly. If the shopper did not pick up the call, he/she will rejoin the queue for a second chance Your program will do the following Add 5 shoppers' name to a queue on a first-come-first-served basis Display the names from the queue on a first-come-first-served basis c.Start calling the shoppers by dequeuing a shopper and generate a random number, call to be between value 1 and 2. If call is 1, the shopper picked up the call. Otherwise, the shopper did not pick up the call Upon picking up the call, a random number, answer to be between value 1 and 2 is generated to simulate the answering of the question. If answer is 1, the shopper answered the question correctly. Otherwise, the shopper did not answer the question correctly However, if the shopper did not pick up the call, he/she will need to rejoin the queue After calling all 5 shoppers, display the following statistic: . all shoppers in the queue with each of their name displayed correctly . number of shoppers who did not pick up the call percentage of shoppers who picked up the call and answered correctly percentage of shoppers who picked up the call and did not answer correctly This question requires logic, and sequence and recursion learnt in LOMA and probability in SANA. 3 Lucky Draw (9% Pong Pong Shopping Mall is having their weekly lucky draw contest. 5 shoppers are chosen from a pool of lucky draw forms at the information counter. These shoppers will form a queue. The shopping mall host will call the shoppers based on the queue and ask them a question. These shoppers will be given a $100 voucher if they have answered the question correctly. If the shopper did not pick up the call, he/she will rejoin the queue for a second chance Your program will do the following Add 5 shoppers' name to a queue on a first-come-first-served basis Display the names from the queue on a first-come-first-served basis c.Start calling the shoppers by dequeuing a shopper and generate a random number, call to be between value 1 and 2. If call is 1, the shopper picked up the call. Otherwise, the shopper did not pick up the call Upon picking up the call, a random number, answer to be between value 1 and 2 is generated to simulate the answering of the question. If answer is 1, the shopper answered the question correctly. Otherwise, the shopper did not answer the question correctly However, if the shopper did not pick up the call, he/she will need to rejoin the queue After calling all 5 shoppers, display the following statistic: . all shoppers in the queue with each of their name displayed correctly . number of shoppers who did not pick up the call percentage of shoppers who picked up the call and answered correctly percentage of shoppers who picked up the call and did not answer correctly This question requires logic, and sequence and recursion learnt in LOMA and probability in SANA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions