python programming week 6 - tuesday. what’s an algorithm?

11
PYTHON PROGRAMMING Week 6 - Tuesday

Upload: percival-ray

Post on 03-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

PYTHON PROGRAMMING

Week 6 - Tuesday

Page 2: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

WHAT’S AN ALGORITHM?

https://www.youtube.com/watch?v=6hfOvs8pY1k

Page 3: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

LAST WEEK

Functions Defining functions Parameters Why bother?

Algorithms Designing algorithms Stepwise refinement

Page 4: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

REMINDERS

Pen portraits – Bradley, Malik

Update targets based on assignment and check existing targets John to go through targets individually

Elvis – set up email on Edmodo

Bradley – assignment 1

MT2 – Cris, Bethany

Page 5: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

TODAY

Algorithms Solve problems using top down development and stepwise refinement

Python Writing functions with and without parameters Calling functions with arguments Some library/built in functions

Page 6: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

ALGORITHM – LARGEST OF THREE NUMBERS From homework:

Find and display the largest of three numbers entered through the keyboard. Solve this using the four major steps method. (Taken from textbook p. 22)

Class activity – get an algorithm on the IWB we are ALL happy with!

Now write the program….

Page 7: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

ALGORITHM DESIGN

Top down design – hierarchy chart for quadratic equation solver Activity – Topic 1.2

Stepwise refinement Activity – sum and average

Page 8: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

PRACTICAL

Codecademy: Functions

Plus Exercises Challenges

Page 9: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

RECAP

What is top down design?

What is stepwise refinement?

What are the four major steps used in computer based problem solving?

What is the difference between and argument and a parameter.

Page 10: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

TOMORROW

More on algorithms

Functions – practice

Assignment 2

Page 11: PYTHON PROGRAMMING Week 6 - Tuesday. WHAT’S AN ALGORITHM?

HOMEWORK

Read through Topic 1.2 and make some notes