A local cinema is running a special promotion. The first 15 customers who purchase a premium ticket receive a free box of popcorn.
An automated system needs to control this promotion. A subprogram called waitForTicketSale() pauses program execution until a premium ticket is successfully purchased by a customer.
A call to this subprogram is represented in the flowchart as a process box containing waitForTicketSale().
Draw a flowchart for a program that outputs the message 'Free popcorn' for each of the first 15 qualifying customers, and then stops.
50 exam-style questions on Edexcel GCSE Computer Science Constructs, covering Structural components of programs and Writing programs with control constructs. Each one has a worked solution and a mark scheme showing where the marks go.