Loading...
Hello, my name is Mrs. Holborow and welcome to Computing.
I'm so pleased that you've decided to join me for today's lesson.
Today's lesson is part one of two, where you'll apply your knowledge of selection to complete a programming project.
In this lesson, we'll focus on the requirements of the project and start developing a solution.
Welcome to today's lesson from the unit Programming selection.
This lesson is called Programming project: Selection I, and by the end of today's lesson, you'll be able to design a solution to a problem that requires the use of selection.
Shall we make a start? We'll be exploring these keywords in today's lesson.
Pseudocode.
Pseudocode: a way of expressing an algorithm that is independent of a specific programming language.
Software development cycle.
Software development cycle: defines the main stages of software development.
Look out for these keywords throughout today's lesson.
Today's lesson is broken down into two parts.
We'll start by analysing the requirements of the project brief.
We'll then move on to build a programme that meets the requirements.
Let's make a start by analysing the requirements of a project brief.
A sandwich shop has the following menu.
So you can see there's different filling options and different prices for sandwiches or wraps.
The sandwich shop also has an offer, so you can add a drink to any sandwich or wrap for one pound, or you can add crisps to any sandwich or wrap for 30p.
A sandwich shop wants an ordering system, which allows customers to: enter which type of sandwich or wrap they would like, select if they want to add crisps to their order, select if they want to add a drink to their order, and then finally, display the cost of the order.
What inputs are going to be needed for the sandwich ordering system? Perhaps pause the video whilst you have a think.
Did you think of any inputs? Let's share some examples now.
So we need to input if the user wants a sandwich or a wrap, the type.
We need to input what filling they want.
We need to input if they want crisps and if they want a drink.
What outputs are going to be needed for the sandwich ordering system? Perhaps pause the video again and have a think.
That's right, there's only one output for this system, and that's the total for the order.
Pseudocode is a method which can be used to represent the design of a system before actually coding the solution.
Pseudocode is useful when analysing the requirements of a project and planning how the solution could be implemented.
The word pseudocode can be broken down into two parts, pseudo and code.
Pseudo means pretend or fake.
Code refers to the instructions written in a programming language.
So the word pseudocode literally means pretend code.
When writing pseudocode, keywords are often capitalised.
For example, INPUT, PRINT.
If, THEN and ELSE.
Note there are many other keywords that are used in pseudocode.
If a customer can select a type, a sandwich or wrap, and then a type of filling, then nested selection statements are going to be needed.
Andeep has a question though.
Andeep says, "I'm not sure I remember what nested selection means." Maybe pause the video whilst you have a think.
Ah, Jun's remembered "Nested selection is when a selection block is placed within another selection block." Okay, we are moving on to the first task of today's lesson, and you are doing a fantastic job.
So well done.
For part one, develop pseudocode for the sandwich ordering system.
How did you get on? Did you manage to develop some pseudocode for the sandwich ordering system? Remember, your style of pseudocode may look different to my solution, but that's absolutely fine.
I've split my pseudocode solution over the next couple of slides because it was quite long.
So on this first slide, I've got lots of PRINT statements, which are displaying the sandwich and wrap prices to the user.
My pseudocode then goes on to have some selection statements.
So at the top you can see I'm initiating the variable price to zero.
I'm then asking the user to input their type and their filling.
I then have, IF type == "Sandwich" and I go through the various different fillings and set the price.
I then have another If, which says IF type == "Wrap" and I go through the filling options for those.
So you can see we're using nested selection here.
We have If and selection statements inside another If statement.
For the final part of my pseudocode, I'm asking the user if they'd like crisps or a drink, and if they answer yes to either of those options, I'm adding that value to the total.
And then on the final line of my pseudocode, I'm printing out the total price of the order.
Okay, we are now moving on to the second part of today's lesson, where we're actually going to start building the programme that meets the requirements.
When approaching a problem that will be solved using code, it's useful to follow the software development life cycle.
So you can see here it starts with planning moves onto analysis, and then design.
We then move on to development, followed by testing and implementation.
The software development life cycle is continuous, so sometimes even after we've implemented a solution, we may have to go back round and add additional features or do additional development and testing.
In Task A of the lesson today, you develop the design by creating some pseudocode for the programme.
So you are working on the design section.
You are now going to move on to the development section to build the programme.
Ah, Izzy looks a bit worried.
Izzy says, "I'm not sure where to start with developing the programme." Sometimes it can be really tricky to start a big project like this, Ah, Andeep's got a great bit of advice.
"Remember to use your pseudocode.
This should help you to create the programme as you can follow the instructions one line at a time." Time for a check.
At which stage of the software development lifecycle could you create pseudocode? Is it A: design, B: testing, or C: development? Pause the video whilst you have a think.
Did you select A: design? Great work.
At which stage of the software development lifecycle do you start to create a programme? Is it A: design, B: testing, or C: development? Pause the video whilst you have a think.
Well done.
You start to create your programme during the development stage of the software development lifecycle.
We're moving on to our final set of tasks for today's lesson, and you're doing a great job, so well done.
I'd like you to use the list of system requirements and your pseudocode from Task A to build the sandwich ordering system.
Remember to pause your video here whilst you complete the activity, or maybe have a look back through the previous slides to make sure you fully understand the requirements of the system.
Good luck.
Okay, we've come to the end of today's lesson and you've done a fantastic job.
Hopefully you've managed to start creating your sandwich ordering system.
Let's summarise what we've learned together today.
When approaching a programming project, there'll be a set of requirements that the programme must solve or meet.
When approaching a programming project, it's sometimes useful to follow the software development lifecycle.
When designing a programme, it's sometimes useful to develop pseudocode before creating the actual programme code.
I hope you've enjoyed today's lesson, and I hope you'll join me again soon.
Bye-bye.