How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts.

Slides:



Advertisements
Similar presentations
Introduction to Programming
Advertisements

2.1 Program Construction In Java
Programming for GCSE Topic 3.1: If Statements in Python T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science.
CS107: Introduction to Computer Science Lecture 2 Jan 29th.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Chapter 2: Algorithm Discovery and Design
Chapter 2: Algorithm Discovery and Design
Introduction to Computers and Programming Lecture 5 Boolean type; if statement Professor: Evan Korth New York University.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 3: Control Structures (Part 1) – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
Chapter 2: Algorithm Discovery and Design
Chapter 2: Algorithm Discovery and Design
ECE122 L9: While loops March 1, 2007 ECE 122 Engineering Problem Solving with Java Lecture 9 While Loops.
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Computer Science 111 Fundamentals of Programming I Iteration with the for Loop.
Fundamentals of Python: From First Programs Through Data Structures
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
Fundamentals of Python: First Programs
Purpose of study A high-quality computing education equips pupils to use computational thinking and creativity to understand and change the world. Computing.
Introduction to Computers and Programming – Computer Programming.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science 6th Edition
Invitation to Computer Science, Java Version, Second Edition.
CS 127 Writing Simple Programs.  Stages involved  Analyze the problem  Understand as much as possible what is trying to be solved  Determine Specifications.
CS1022 Computer Programming & Principles Lecture 1.2 A brief introduction to Python.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
An Overview of Programming in Python CSC 161: The Art of Programming Prof. Henry Kautz 9/9/2009 Slides stolen shamelessly from Dr. Mark Goadrich, Centenary.
By the end of this session you should be able to...
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Chapter 1. Objectives To provide examples of computer science in the real world To provide an overview of common problem- solving strategies To introduce.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
Basic Control Structures
Algorithm Design.
Python uses boolean variables to evaluate conditions. The boolean values True and False are returned when an expression is compared or evaluated.
Programming for GCSE Topic 4.2: Faults and Debugging T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen.
How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts.
Advanced Program Design. Review  Step 1: Problem analysis and specification –Specification description of the problem’s inputs and output –Analysis generalize.
Program Development C# Programming January 30, 2007 Professor J. Sciame.
Review for Final Exam. Contents 5 questions (20 points each) + 1 bonus question (20 points) – Basic concepts in Chapters 1-4 – Chapters 5-9 – Bonus: Chapter.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Programming for GCSE Topic 8.1: Functions T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen Mary University.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science.
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Getting Started With Python Brendan Routledge
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
what is computer programming?
Topic: Programming Languages and their Evolution + Intro to Scratch
CS1022 Computer Programming & Principles
1-1 Logic and Syntax A computer program is a solution to a problem.
Chapter 9 Structuring System Requirements: Logic Modeling
Think What will be the output?
Introduction to Programmng in Python
CS190/295 Programming in Python for Life Sciences: Lecture 1
Software Programming J. Holvikivi 2014.
Algorithms and Flow Charts
Problem Solving Techniques
Learning to Program in Python
Today’s lesson – Python next steps
Programming Right from the Start with Visual Basic .NET 1/e
Chapter 9 Structuring System Requirements: Logic Modeling
Review for Final Exam.
Coding Concepts (Basics)
Introduction to Algorithms - 1
Review for Final Exam.
Chapter 9 Structuring System Requirements: Logic Modeling
Primary School Computing
Presentation transcript:

How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts Overall reflection Continue practical exercises at home Getting Started Log-on Find portable Python on L:\ drive and start IDLE Go to Find resources on teachinglondoncomputing.org teachinglondoncomputing.org Exercise sheet (and notes) – START NOW Example programs Slides

KS3 and Beyond Transition from Scratch to Python using Turtle Graphics T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London

Outline A first turtle program in two languages Discussion: barriers to textual programming Learning Programming Progressively The turtle language Translating between Scratch and Python Practical examples Summary

First Program from turtle import * # Added code starts here pencolor('blue') pensize(10) forward(100) right(90) forward(100) right(90) forward(100) right(90) forward(100) right(90) # Added code ends here done()

Discussion What are the challenges of learning textual programming?

Challenges of Text Programming Accuracy – easy to make mistakes Blank sheet problem – lack of starting point Motivation – not visual Solving a problem: decomposition Understanding programming concepts Sequence, choice, repetition, state (variables) Debugging

Progress in Learning Programming KS1 onwards Computers accept commands: algorithm … turtle often used Decomposition: sequences, choice and repetition Challenges Learning Scratch versus learning programming Core concepts Problem solving and debugging Programming concepts

Core Programming Concepts Sequence: one instruction follows another State: variables hold values and can change Choice: alternative instructions Repetition: repeating instructions Input and output Values (expressions) versus statements Abstraction: procedures / functions

Turtle Language – I Role of turtle in Scratch and Python Turtle is a little language inside a more general language Essential commands Forward Left Right Pen up Pen down General language concepts Sequence Repetition (bounded) Function abstraction

Turtle Language – II Use of co-ordinates and headings Get and set co-ordinates Get and set heading Also Distance Towards General language concepts Variables Choice

Translating Scratch & Python Same core concepts Overlapping problems that can be easily solved

num = 0 sum = 0 while x <= 10: x = x + 1 sum = sum + num print('Sum … is', sum) Comparing Shapes and Text No punctuation or spelling errors Direct representation of inside loop Indentation (Python) Brackets (C, Java, …)

Control Statements – Close for x in range(1, 10): print(“Hello”) x = 0 while x != 100: forward(1) if mouseDown(): forward(10) else: right(15)

Variables – Set and Change Later in scratch Variables: Sprite Global Steps = 0 Steps = Steps + 1 Value of the variables Python uses name for both left and right hand side of assignment

Programming Concepts ConceptComparison Arithmetic operatorsVery similar Logical operatorsVery similar SelectionVery similar LoopsScratch has more forms Variables and typesScratch does not distinguish strings from numbers AssignmentClearer in Scratch Input and outputScratch equivalents for input / print BroadcastNo direct equivalent: decomposition FunctionsSimilar SpritesNo direct equivalent

Introduce Assignment Exploit different syntax to emphasise that assignment is not equality Python Means the same as: Total = Total + ItemCost * Number

Practical Problems

Equivalence Two programs can have same behaviour Different forms of ‘if’ or ‘loop’ Logical equivalence Repetition versus loops Redundant code Code that makes no difference Easy to include this in Scratch

Problem 1: If & Logic Two variables: 'name and 'age' Which versions are the same?

Problem 2: Counting to 5 Which are the same?

Summary Ideas for transferring from visual to textual programming Core programming concepts: make the correspondence explicit Problem solving, abstraction and decomposition: build on existing ideas