Skip to content
Gallery
Solution Cinema World Update
Share
Explore

icon picker
The Task

Cinema World Update 🥤

Do you remember the Cinema World program?
The user entered their name, a film, the number of drinks and the number of tickets requested.
The tickets cost £5 each and the drinks cost £2 each.
The program calculated the ticket total, the drinks total and the combined total cost.
The program output an order confirmation showing all the above details along with the total costs.
You are going to update this program to deal with a new requirement which relies on an option or condition.

update requirements

Cinema World have tested their program and released they have missed the age check on their self service and would like this to be added.

Design for the conditional step

IF age > film age rating THEN
display ticket confirmation and price
ELSE
display sorry not old enough message
END IF
These steps must happen after the age is entered but before any calculations. Take care over inserting the new code into the correct place within the existing code.

Start here

Work in pairs to will update your Cinema World program so that it includes an age rating.
Add these steps as comments between input and existing calculations.
Use CodeClips to help insert the code which matches the comments you have inserted.

Sample Output

Full Name: Jake Peralta
Age: 30
Film Name: Die Hard
Film age rating: 18
Number of tickets: 2
Number of drinks: 2

CINEMA WORLD
=============

Ticket confirmation

Full name: Jake Peralta
Film title: Die Hard
Tickets ordered: 2
Drinks ordered: 2
Amount to pay : £14
Full Name: Max Mayfield
Age: 15
Film Name: Halloween
Film age: 18

CINEMA WORLD
=============
Sorry you are not old enough
Full Name: Billy Hardgrove
Age: 18
Film Name: Halloween
Film age rating: 18
Number of tickets: 2
Number of drinks: 1

CINEMA WORLD
=============

Ticket confirmation

Full name: Billy Hardgrove
Film title: Halloween
Tickets ordered: 2
Drinks ordered: 1
Amount to pay : £12
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.