Professor sprenkle sprenkles@wlu edu september 11 2007
Download
1 / 10

Lab 0 - PowerPoint PPT Presentation


  • 1099 Views
  • Updated On :

Professor Sprenkle [email protected] September 11, 2007. Lab 0. Objectives. Why programming languages? Start lab #0 UNIX/Linux Portal account (Blog for “Broader CS Issues”) Web page Text Editor Python. Why Do We Need Programming Languages?. Computers can’t understand English

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Lab 0' - Michelle


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Professor sprenkle sprenkles@wlu edu september 11 2007 l.jpg

Professor Sprenkle

[email protected]

September 11, 2007

Lab 0


Objectives l.jpg

Sprenkle - CS111

Objectives

Why programming languages?

Start lab #0

UNIX/Linux

Portal account (Blog for “Broader CS Issues”)

Web page

Text Editor

Python


Why do we need programming languages l.jpg

Sprenkle - CS111

Why Do We Need Programming Languages?

  • Computers can’t understand English

    • Too ambiguous (PB&J)

  • Humans can’t easily write machine code

Problem Statement (English)

Machine code/Central Processing Unit (CPU)

000000 0000100010 00110 00000 100000


Why do we need programming languages4 l.jpg

Sprenkle - CS111

Programmer (YOU!) translates from problem to algorithm (solution) to program

Python interpreter translates into bytecode

Why Do We Need Programming Languages?

  • Computers can’t understand English

    • Too ambiguous (PB&J)

  • Humans can’t easily write machine code

Problem Statement (English)

Algorithm/Pseudocode

High-level Programming Language (Python)

Bytecode

Machine code/Central Processing Unit (CPU)


Why do we need programming languages5 l.jpg

Sprenkle - CS111

Why Do We Need Programming Languages?

  • Computers can’t understand English

    • Too ambiguous (PB&J)

  • Humans can’t easily write machine code

Problem Statement (English)

Algorithm/Pseudocode

High-level Programming Language (Python)

Python interpreter executes the bytecode in a “virtual machine”

Bytecode

Machine code/Central Processing Unit (CPU)


Python is l.jpg

Sprenkle - CS111

Python Is

  • A programming language

  • An interpreter (a program)


Python interpreter l.jpg

Sprenkle - CS111

Have a lot of these early on!

Python Interpreter

  • Validates the Python programming language expression

    • Enforces Python syntax

    • Reports syntax errors

  • Simulates a computer (executes the expression)

Python

expression

Interpreter

(python)

Only if no syntax errors

Output

Executable

bytecode


Python interpreter8 l.jpg

Sprenkle - CS111

Have a lot of these early on!

Python Interpreter

  • Validates the Python programming language expression

    • Enforces Python syntax

    • Reports syntax errors

  • Simulates a computer (executes the expression)

    • Runtime errors (e.g., divide by 0)

    • Semantic errors (not what you meant)

Python

expression

Interpreter

(python)

  • Good way to test expressions

Output

Executable

bytecode


Our programming process l.jpg

Sprenkle - CS111

Our Programming Process

Programmer types a program/script into a text editor(jEdit or IDLE).

An interpreter turns each expression into bytecode and then executes each expression

Program

text file

program.py

Text Editor

(jEdit or IDLE)

Interpreter

(python)

1 “line” at a time

  • Get feedback about which line caused the problem

  • Interpreter stops validating/executing lines

Output

Executable

bytecode


Lab 0 l.jpg

Sprenkle - CS111

Lab 0

  • Start on paper --> Web, after log in

  • Linux worksheet

    • Login

    • Open browser

    • Navigate to Lab 0, from “Schedule” page

  • Continue on Web-based Lab 0


ad