Lesson video

In progress...

Loading...

Hello, my name is Mrs. Holborow, and welcome to Computing.

I'm so pleased you've decided to join me for the lesson today.

This is a project-based lesson, where you'll plan and create a programme which uses sequence.

Welcome to today's lesson from the unit Programming sequence.

This lesson is called Programming project: sequence I, and by the end of today's lesson, you'll be able to plan a programme using a structured design and write code by following a clear step-by-step sequence.

Shall we make a start? We will be using these keywords in today's lesson.

Decomposition.

Decomposition: breaking down a problem into smaller parts to make the task more manageable.

Flowchart.

Flowchart: a visual representation of an algorithm or programme.

Look out for these keywords in today's lesson.

Today's lesson is broken down into two parts.

We'll start by investigating a project brief, and then we'll move on to design a programme using a structured approach.

Let's make a start by investigating a project brief.

SplashZone Water Park has launched a new online booking system for day passes.

Design and programme a system for customers to use when booking a visit.

The ticket price is 25 pounds per person per day.

There is car parking at 10 pounds per car, which covers all days booked.

You will create a Python programme to book ticket sales for SplashZone Water Park.

Your programme should 1, display the ticket price, 2, display car parking at 10 pounds per car, covers all days booked, 3, ask for the lead booker's name, 4, ask for how many people and days they are booking for, 5, ask for how many cars need car parking, 6, calculate and display the total cost, 7, ask for payment and calculate change, if there is any, and 8, confirm the booking and thank the customer.

An output from the programme may look similar to this.

So you can see we have a welcome message, followed by the ticket entrance prices.

We ask for the lead booker's name and then we ask for how many days and how many tickets are required.

We also ask for how many cars are required for parking, and then we display the total cost and allow the user to enter payments.

Time to check your understanding.

Which of the following is not a requirement of the SplashZone Water Park booking system? Is it a, display the ticket price? b, ask for the lead booker's name, or c, calculate the discount for annual members? Pause the video whilst you have a think.

Did you select C? Well done.

This programme does not calculate any discount for annual members.

Using a structured approach means breaking down a problem into smaller parts to make it easier to solve.

This process is called decomposition.

A diagram can be created to decide on the different parts of the programme.

True or false? Decomposition makes problems more complex to solve.

Pause the video whilst you have a think.

That's right.

It's false.

It's false because decomposition simplifies problem-solving by breaking down a large problem into smaller, more manageable parts.

The programme has lots of requirements and will need to be broken down into smaller parts.

The first part could be to display ticket prices.

So you can see at the top of my diagram, I now have ticket booking system plan, and then my first section is going to be to display ticket prices.

The system will need to display the ticket price to the user.

For the first activity of today's lesson, I'd like you to plan out the remaining parts of the ticket booking system.

So what other parts could we break or decompose the problem down into? If you need to, you can pause the video here or even go back to the list of requirements if it's helpful.

How did you get on? Did you manage to break the problem down? Great work.

Here's a sample solution.

You may have divided the problem into different parts, so don't worry if your solution looks a little bit different to this.

So we already had display ticket prices, but we also now have calculate entrance price, calculate car parking price, collect payment, and then the ticket summary, so printing out the ticket to the user.

Did you have something similar? For the second part of this activity, I'd like you to plan out the remaining parts of the ticket booking system.

So we're adding a little bit more detail here about what each part of the system is going to do.

So for display ticket prices, we have the system will need to display the ticket price to the user.

Now, you may have broken down the problem slightly differently to what I've done, so you may need to add more parts to your diagram here.

Pause the video whilst you have a go.

How did you get on? Did you manage to plan out the remaining parts? Remember, this is just a sample solution.

So for the entrance price, I've said that we're going to have to calculate the entrance price, which will be the number of people multiplied by the total cost and the number of days, and then we're going to need to display the total price.

For the car parking price, we need to calculate the parking price, so that's gonna be the number of cars multiplied by the parking price.

We are then going to display the total car parking price and the new total.

For collecting payment, we're going to need to ask for payments, so we're going to display the total cost.

We're then gonna have to calculate the change, so the payment amount minus the total amount.

For the last section for the ticket summary, we're going to have to show the payment and change amount, if there is any.

Remember, your solution may be slightly different to this, and that's absolutely okay.

Okay, we're now moving on to the second part of today's lesson, and you've done a fantastic job so far, so well done.

We're now going to design a programme using a structured approach.

A flowchart is a diagram used to illustrate the steps of an algorithm.

flowcharts are made up of symbols, each containing a single step of the programme.

The shape of the symbol represents the type of step that the symbol contains.

Arrows are used to show the flow of execution.

When investigating the requirements of a system, it's useful to plan the programme flow using a flowchart.

Here's a reminder of some of the flowchart symbols.

So we have the terminal shape.

We have the flow line.

We have the process, which is a rectangle, and then we have the parallelogram, which is used for input and output.

The terminal symbol marks the start and end of a programme.

It's represented by an oval.

Here's an example for at the start of a programme and at the end of a programme.

The process symbol represents any action, such as calculations or any step where data is manipulated.

It's represented by a rectangle.

So here's an example, calculating the total cost of a ticket.

So total is equal to price multiplied by quantity.

The flow line symbol shows the direction of the flow of the programme, connecting other symbols.

It's represented by an arrow, so it shows flow from one action to the next, in this example, from calculating total cost to displaying the results.

The input/output symbol represents any action that involves user input or programme output, and it's represented by the parallelogram.

So here's an example, maybe asking the user for their name or displaying the total cost to the user.

Time to check your understanding.

Which flowchart symbol is used to represent a flow line? Is it a, b, or c? Pause the video whilst you have a think.

That's right.

I knew you'd get that one right.

A is the correct symbol for the flow line.

Sam has created a flowchart for the first part of the ticket sales for the SplashZone Water Park.

So you can see at the top, we have the start symbol, and then we have an output, which says, "Welcome to SplashZone Water Park." We then have another output, which asks the user what is their name.

Sam has also started to use the process symbol for part of the programme.

So at the top of this part, we have input the number of tickets required, and then we have a process symbol, which is calculating the total, so total is equal to price multiplied by quantity.

We then have another parallelogram or input/output, which is going to output the total.

What type of symbol is this in Sam's flowchart? Pause the video whilst you have a think.

Did you say input or output? Well done.

Sam is asking how many tickets the user would like to purchase here, so it's an example of input.

Okay, were now moving on to our next set of tasks for today's lesson.

I'd like you to create a flowchart to represent the ticket sales system for SplashZone Water Park, using the project brief to help you.

Remember, you split the project into different parts in Task A, so you may well want to have different flowcharts for each section of the project.

If you need to, you can pause the video whilst you complete the activity and even go back to the slides where we have the project requirements.

Good luck.

How did you get on? Let's have a look at a sample flowchart together.

So this is only for a small section of the programme.

So firstly, display the welcome and ticket price to the user, input the username, input the number of days, and input the number of people.

Here's another example.

This time, we're using some processes here.

So at the top.

we have input the number of cars for parking.

So that's taking in from the user how many cars they're going to need to bring.

We then have some processes, so we're calculating the total ticket price by multiplying the number of people by the number of days by the ticket price.

We're then calculating the total parking cost by multiplying number of cars by parking price.

And then we're calculating the total cost by adding together the total ticket price and the total parking price.

Did you have something similar? Remember, if you need to pause the video here and go back and make any improvements to your flowcharts, you can do that now.

Here's another section.

So this time, we have some input/outputs again.

So this time, we're gonna output the total cost, and we're gonna ask the user for payment.

We're then using another process to calculate the change.

So change is equal to payment minus total cost, and then we're displaying payment summary and any change.

Okay, we've come to the end of today's lesson.

and you've done a great job to understand the requirements of the project and decompose the problem.

Let's summarise what we've learned together.

A project brief outlines the program's requirements.

Decomposition is the process of breaking down a large task into smaller, manageable steps for implementation.

A flowchart is a visual representation of a programme showing the sequence of steps that the programme follows.

I hope you've enjoyed today's lesson, and I hope you'll join me again soon.

Bye.

(mouse clicks).