Unit 1, Lesson 3 Program Execution Process AOIT Introduction to Programming Copyright © 2009–2012 National Academy Foundation. All rights reserved.

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 1 Engineering Problem Solving.
Advertisements

Lesson 4 0x Operating Systems.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Computer Components.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
UNIX Chapter 01 Overview of Operating Systems Mr. Mohammad A. Smirat.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
Chapter 1- Visual Basic Schneider 1 Chapter 1 An Introduction to Computers and Visual Basic.
How to install the Zelle graphics package
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Copyright © 2005 Rockwell Automation, Inc. All rights reserved. 1 Starting & Stopping Motors Micro Logix 1100 RSLogix 500 LAB#1.
Computing Fundamentals Module Lesson 1 — Essential Computer Skills Computer Literacy BASICS.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Introduction to Computer Administration Introduction.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Lesson 2 Information Processing. Objectives Define hardware and software Explain the three basic computer functions: input, processing, and output.
System software operating system 1.
Introduction to Python
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Operating Systems.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Booting. Booting is the process of powering it on and starting the operating system. power on your machine, and in a few minutes your computer will be.
Visual C++ Programming: Concepts and Projects
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
EG280 Computer Science for Engineers Fundamental Concepts Chapter 1.
Lesson 01: Introduction to Database Software. At the end of this lesson, students should be able to: State the usage of database software. Start a database.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 4: Writing programs.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Chapter 1 09/04/13. Change Your Password  The command is: passwd In the lab first do : ssh -Y onyx  You will have to see me to change it, if you forget.
8 January 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
Introduction to Programming Python Lab 1: My First Program 8 January PythonLab1 lecture slides.ppt Ping Brennan
Written module activity, Page 16 1.We refer to the physical parts of a computer that we can touch and see as hardware. Examples include the mouse, the.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
The Big Picture. My Story  Wrote great programs  Didn’t understand how they worked.
Introduction to: Python and OpenSesame FOR PROS. OpenSesame In OpenSesame you can add Python in-line codes which enables complex experiment. We will go.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
1 Security Architecture and Designs  Security Architecture Description and benefits  Definition of Trusted Computing Base (TCB)  System level and Enterprise.
VIRTUAL NETWORK COMPUTING SUBMITTED BY:- Ankur Yadav Ashish Solanki Charu Swaroop Harsha Jain.
An Introduction to Programming with C++1 An Introduction to Control Structures Tutorial 1.
BASIC PROGRAMMING C SCP1103 (02)
Development Environment
Lesson 4 0x Operating Systems.
Introduction to Programming
Key Ideas from day 1 slides
Introduction to Programming
BASIC PROGRAMMING C SCP1103 (02)
An Introduction to Computers and Visual Basic
An Introduction to Computers and Visual Basic
Introduction to Programming
Introduction to Programming
An Introduction to Computers and Visual Basic
Introduction to Programming
Introduction to Python
 Is a machine that is able to take information (input), do some work on (process), and to make new information (output) COMPUTER.
Presentation transcript:

Unit 1, Lesson 3 Program Execution Process AOIT Introduction to Programming Copyright © 2009–2012 National Academy Foundation. All rights reserved.

When Python executes circle.py, it draws a red circle from turtle import * title("circle program") setup() turtle.up() turtle.goto(0,20) turtle.down() turtle.color("red") turtle.width(2) turtle.begin_fill() turtle.circle(50) turtle.end_fill() done()

Program execution begins with Start Before you begin to run a program, think about the results you expect. What does circle.py do? What is the output? Start Hardware ComponentsSoftware Components Program execution is ready to start when IDLE is open and you have opened circle.py. Each step of the program execution process includes software and hardware components.

In step 1, the user selects Run Module 1 Start 1. User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell and.py file In which IDLE window is the Run menu? Using the mouse, the user selects Run > Run Module. What do you know about the software and hardware components used in this step?

In step 2, the parser deconstructs the program 1 Start 2 User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell and.py file 2. Read in and parse program Python parser and.py file Computer processor and disk drive What do you suppose “deconstruct” means? The parser reads in the Circle program and deconstructs it into its primitive components.

In step 3, the parser displays an error, if any 1 Start 2 User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell and.py file 3 Read in and parse program Python parser and.py file Computer processor and disk drive 3. If syntax error Send error message and exit Yes No If the parser detects an error, it stops running and returns an error message to the screen. If there is no error, the parser keeps running. The pop-up error message always says the same thing. What is it?

In step 4, the parser builds an execution table Start 4. Build execution table Python parser and.py file Computer processor and disk drive 2 User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell and.py file 3 Read in and parse program Python parser and.py file Computer processor and disk drive If Syntax Error 4 Send error message and exit Yes No The parser builds an execution table. This table contains a description of each statement in the program. Why might the parser need to build an execution table? Why couldn’t it always read the program top to bottom, left to right, like a book?

In step 5, the executor runs the program 1 Start 2 User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell and.py file 3 Read in and parse programPython parser and.py file Computer processor and disk drive If Syntax Error 4 Send error message and exit 5. Execute programPython executor and.py file Computer processor and screen 5 Build execution tablePython parser and.py file Computer processor and disk drive Yes No A software component called the Python executor runs the program by calling internal machine instruction functions one after the other. For circle.py, this means the machine instruction functions actually draw the circle. What are some functions you have seen in Python programs?

In step 6, the executor returns control to the shell Start 2 User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell &.py file 3 Read in and parse program Python parser and.py file Computer processor and disk drive If Syntax Error 4 Send error message and exit 6 Execute program Python executor and.py file Computer processor and screen 6. End program and wait for drawing window to be closed 5 Build execution table Python parser and.py file Computer processor and disk drive Python shellComputer processor, screen, and mouse Yes No When the executor reaches the last statement, it returns control to the shell. The shell waits for the drawing window to be closed. What is the last statement of the Circle program?

The end point is always Start End 2 User: Run > Run Module Hardware Components Software Components Computer processor, disk drive, and mouse Python shell and.py file 3 Read in and parse programPython parser and.py file Computer processor and disk drive If Syntax Error 4 Send error message and exit 6 Execute programPython executor and.py file Computer processor and screen 7 End program and wait for drawing window to be closed 5 Build execution tablePython parser and.py file Computer processor and disk drive Python shellComputer processor, screen, and mouse Yes No When the program ends, the drawing window closes. What is the drawing window? End

The program execution process draws the circle Start End 1. User: Run > Run Module Hardware ComponentsSoftware Components Computer processor, disk drive, and mouse Python shell and.py file 2. Read in and parse program Python parser and.py file Computer processor and disk drive If syntax error 3. Send error message and exit 5. Execute program Python executor and.py file Computer processor and screen 6. End program and wait for drawing window to be closed 4. Build execution table Python parser and.py file Computer processor and disk drive Python shellComputer processor, screen, and mouse Yes No