Software Development Algorithms and Language Constructs (sequence, selection and iteration) Higher Computing.

Slides:



Advertisements
Similar presentations
Instructions for families: When introducing a new section:
Advertisements

Sample questions from the Motorway Rules units of the Driving Theory syllabus. ESOL for Driving.
Smarter software for smarter travel Car & Journey Sharing travel and parking solutions Jambusters.
Everyday Algorithms David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. lightning introduction to.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
Honda Shadow Owners UK 2nd Person Drop Off Bike Convoy
Right and Left Turns.
Chapter 1 - An Introduction to Computers and Problem Solving
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Basics of Computer Programming Web Design Section 8-1.
Zydus School for Excellence Godhavi Safety at School School Transport _Safety.
Driver’s Safety Pg
Class 6 Designed by Marina V. Bedniagina School 32 Nizhniy Tagil 2010.
Downloading and Installing AutoCAD Architecture 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the software.
Chapter 5 – Signs, Signals and Markings
Drive Right chapter 2 Thursday, April 20, 2017 lesson 2.1
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
Mathematics Rotational Symmetry.
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Flowchart IDT. What is a flowchart? Visual representation of a flow of data Outline of process or a solution to a problem Outline the basic logic behind.
Problem Solving and Mazes
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
The Logical Structure of Algorithms. Algorithms Steps necessary to complete a task or solve a problem. Example: Recipe for baking a cake –Will contain.
Introduction to Piecewise Functions Unit 8.05 I can write a story based on the graph of a piecewise function. I can create a piecewise function graph based.
Mrs. Shirk’s Class Welcome to 8 th grade. Entering the classroom Line up outside the room and wait for the students from the previous class to exit Enter.
Tom is learning the traffic rules
Kindergarten Mrs. Anderson’s Class. Tonight… Sign in—Make sure I know how your child is getting home the first day. Label pencil box with name Complete.
Bug Session Four. Session description Objectives Session activities summary Resources Prior knowledge of sequencing instructions using Bug Bug website.
Poses Tutorial Alex Boldt Under the direction of Professor Susan Rodger Duke University July 2015.
By the end of this session you should be able to...
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Teacher: Zhou Yufan( 周宇凡 ) Class: Class One, Junior Two Date:
Lesson Counting Techniques. Objectives Solve counting problems using the Multiplication Rule Solve counting problems using permutations Solve counting.
CPS120 Introduction to Computer Programming The Programming Process.
Implementing software in IEC Languages in IEC IEC uses the following languages Instruction List – Assembly level programming using.
6. It’s next to the bank. Are you ready to start?.
RIGHT TURNS A step by step guide intended to support the practical training. Select Slide Show from the top Toolbar then From Beginning. Let it run until.
CMP-MX21: Lecture 5 Repetitions Steve Hordley. Overview 1. Repetition using the do-while construct 2. Repetition using the while construct 3. Repetition.
 Please go  Instructions to follow……You will be logging in on STUDENT LOG-IN….
Introduction to Loops For Loops. Motivation for Using Loops So far, everything we’ve done in MATLAB, you could probably do by hand: Mathematical operations.
CALL (COMPUTER-ASSISTED LANGUAGE LEARNING)
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving Week 3: Algorithms Stewart Blakeway FML 213
Section 1 (Day 3) Virginia Driver Responsibilities: Licensing Responsibilities.
Residential – part B RAILROAD SITUATIONS What must you do at all railroad crossings? Slow down and check both ways. However, you must stop when the.
© The McGraw-Hill Companies, 2006 Chapter 3 Iteration.
Mile-long hurdle race Suppose that we want to program Karel to run a one-mile long hurdle race, where vertical wall sections represent hurdles. The hurdles.
Algorithms. Teacher Lead Activity What is an algorithm? Homework Recap!
Presenter’s name Presenter’s title. Contents The current situation Reducing collisions in London [INSERT ORGANISATION NAME]’s policy How we’re helping.
TRAFFIC PROBLEMS IN GLASGOW Lesson starter:  You have a piece of poster paper in front of you.  You must draw a line down the middle of it.
“Save As” 1.To the I drive 2.With your LastName FirstrName at the beginning of the file name. (ex. - Hurlow Dan Links.ppt) Go to the next slide.
Algorithms and Flowcharts
Scenario: The lone girl. Call from Police. Call from Police. Patrol response. Patrol response. Situation Poser. Situation Poser. Follow up. Follow up.
TRANSPORTATION TUESDAY
Driver’s Education Section IV Day 2.
Mile-long hurdle race Suppose that we want to program Karel to run a one-mile long hurdle race, where vertical wall sections represent hurdles. The hurdles.
Lesson – Teacher Notes Standard:
Basics of Computer Programming
Introduction To Flowcharting
Basics of Computer Programming
Performing Basic Maneuvers
Basics of Computer Programming
Basics of Computer Programming
lesson 15.3 PASSING AND BEING PASSED ON RURAL ROADS
Problem-Solving and Control Structures By Faith Brenner
This is an optional module
WJEC GCSE Computer Science
Begin working silently on your article of the week.
Body(身體) Random Slide Show Menu
Presentation transcript:

Software Development Algorithms and Language Constructs (sequence, selection and iteration) Higher Computing

Lesson Aims and Objectives 1.Sequence This lesson will introduce you to algorithms for: 2. Selection 3. Iteration Most programming languages have constructs to support these algorithms

Algorithms Algorithms, which are just written- out sets of instructions to do something, consist of two things: 1. the actions that must be taken, and 2. the order they must be done in. The sequence of instructions Lights – Camera – Action not only tells a film crew what to do but also the order in which to do things. MIRRORS – SIGNAL - MANOEUVRE

Sequence Most simple algorithms found in everyday life are short and involve doing a series of things one after another. Buying a rail ticket 1. Select destination. 2. Select ticket type. 3. Insert correct money. 4. Take change. 5. Take ticket. The most common convention in programs and in everyday life is that we follow the instructions, starting at the top and working down the list, doing the instructions in the order given (this is a sequence of instructions)

Sequence Study this maze and make a plan for a race to the centre. During the race you cannot take your plan. Once you have worked out the route to the centre of the maze, you must memorise an algorithm that you must follow to get to the centre. Write an algorithm for the shortest route using the actions below: Enter the maze by the gate following the path ahead. Turn left following the path ahead. Turn right following the path ahead. Go straight across the junction following the path ahead. Stop at the cross.

If only... (Selection) Sequencing is not the only way instructions can be ordered You can alter the sequence of instructions depending on the situation. This is known as selection or branching. Putting on an airline oxygen mask 1. Place mask over your nose and mouth. 2. Secure with the elastic behind your head.

If only... (Single Branch Selection) Putting on an airline oxygen mask 1. secure your mask 2. if you are travelling with a child then 3. secure the mask of the child 4. endif 5. sit back The instructions given also consider situations other than the basic one. “if you are travelling with a child then secure your mask first, then secure the mask of your child Sequence– with child 1->2->3->4->5 Sequence – without child 1->2->4->5

If only... (Single Branch Selection) Deciding To Take A Break 1. if need a break then 2. pull into service station 3. park car 4. have coffee 5. use slip road onto motorway 6. end if 7. continue journey A motorway has a service station. A driver, drives down the motorway. On seeing the sign for the Service Station, she asks herself the question “Do I need a break”. If the answer is yes, she pulls in and has a coffee. On finishing the coffee she pulls back onto the motorway, using the exit slip road. If the answer is no, she just drives on and performs no action. In either case she arrives at the same point to continue her journey.

Play it Again Sam (Fixed Iteration) Writing Lines 1. for counter = 1 to 100 do 2. write punishment line 3. next counter At school as a punishment you might have to write lines: writing the same thing over and over again. “Write out 100 times, ‘I must not throw chewing gum at the teacher’ ” “Write out 30 times, ‘I must not break up my desk and pass the bits out of the window behind the teacher’s back’ ”, With fixed iteration we know in advance the number of times an instruction needs to be repeated

Play it Again Sam (Conditional Iteration) Suppose you wish to read all the books on your bookshelf. This is a situation where you are doing a similar thing over and over again. It should therefore be possible to describe it by giving the instructions to be repeated and the instructions on when to stop. The repetitive task (the body) is: 1. Pick a book that you have not read. 2. Read the book. 3. Put the book back. Termination Condition Continue, provided there are books on the shelf you have not read

Play it Again Sam (Conditional Iteration) Reading all books on my bookshelf 1. Do 2. Pick a book that you have not read. 3. Read the book. 4. Put the book back 5. Loop while books on shelf I have not read

Activities 1.Review this PowerPoint. di 2. Complete the sheet on my web page. Save as directed.