comp 110 – introduction to programming

Post on 24-Feb-2016

42 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Comp 110 – Introduction to Programming. Instructor: Jason Carter. Computer World. Theater Analogy. Play Concert Talk Speech Cooking Lessons Town Hall Meeting. Fetched from. Management. M anages. Theater. Performer. A ssists. Stagehand. Real. Trial. Archive. - PowerPoint PPT Presentation

TRANSCRIPT

COMP 110 – INTRODUCTION TO PROGRAMMING

Instructor: Jason Carter

COMPUTER WORLDHardware MemoryOperating System Memory PageProgram Memory WordProcessor Memory Address Instruction (e.g. add 2 to 5) Running a ProgramSource Code Interactive ProgramObject Code Non-interactive (Batch) ProgramProgramming Language Program argumentsMachine Language Runtime Programmers EditorLibrary (of Code) Editing ProgramsTranslator (Compilers/Interpreter) Lexical ErrorUsers Syntax Error Disks Semantics Error

Logic ErrorDebuggingStyle Principles

THEATER ANALOGY Play Concert Talk Speech Cooking Lessons Town Hall Meeting

THEATER WORLD – PART 1

Performer

Theater

Performer

Stage

Audience

Performs

Real Trial

Performance Script

Follows

Performance Language

Written in

Notebook or Teleprompte

r

Stored in

Archive

Fetched from

StagehandAssists

ManagementManages

THEATER WORLD – PART 2Performance

ScriptPerformance

LanguageWritten in

Original ScriptScript

LanguageWritten in

Translator Translator (Interpreter)

Writes entire script

Reads entire script

Speaks sentence

Hears sentence

THEATER WORLD – PART 3

Original ScriptScript

LanguageWritten in

Script Writer

Written by

Typewriter, Text Editor

UsesSecretary

Reference Material

LinksSyntax, Semantics,

Logic, & Style

Problems

Checked by

Word Processor, Script Writer

Translator / Interpreter,Stagehand, Performer

COMPUTER WORLD – PART 1

Processor

Computer

Users

Interacts with

Real Debugging

Object Code

Follows

Machine Language

Written in

Memory

Stored in

Disk, Tape

Fetched from

RuntimeAssists

Operating System

Manages

COMPUTER WORLD – PART 2Object Code

Machine Language

Written in

Source CodeProgramming Language

Written in

Compiler Interpreter

Writes entire

source code

Reads source code

Writes statement

Reads statement

Processor

Compiler

Interpreter

Source Code

Platform Independent

Intermediate Code

Platform Specific Machine Code

TRANSLATING USING BOTH A COMPLIER AND AN INTERPRETER

THEATER WORLD – PART 3

Source CodeProgramming Language

Written in

Programmer

Written by

Typewriter, Text Editor

UsesLinker

Libraries

LinksSyntax, Semantics,

Logic, & Style

Problems

Checked by

Editor, Programmer, Translator, Operating

System Runtime, Processor

COMPUTER VS. THEATERComputer Theater

Hardware TheaterOperating System Theater ManagementProgram PerformanceProcessor PerformerInstruction (e.g. add 2 to 5) Performance action (e.g. walk 3

steps.)Source Code Original ScriptObject Code Performance ScriptProgramming Language Script Language (e.g. German)Machine Language Performance Language (e.g.

English)Programmers Script WritersLibrary (of Code) Reference Material (from Books)Translator (Compilers/Interpreter) Translator (Before/During

Performance)Users AudienceDisks Archival Storage AreasMemory Script performance notebook

accessible to performersHardware Theater

COMPUTER VS. THEATERComputer Theater

Memory Page A Notebook PageMemory Word A Notebook LineMemory Address (Page Number, Word Number)

Line Identification (Page Number, Line Number)

Running a Program Performing a ScriptInteractive Program Performance with audience

participationNon-interactive (Batch) Program Performance with no audience

participationProgram arguments Special instructions at start of

performanceRuntime Stage-HandsEditor Typewriter/WordprocessorEditing Programs Writing ScriptsLexical Error Spelling ErrorSyntax Error Grammar ErrorSemantics Error Inconsistencies in ScriptLogic Error Execution Error Debugging Staging trial performancesStyle Principles Style Principles

COMPUTER VS. THEATER CPU is fast: can do several performances at one

time. CPU is dumb: no improvisation possible. Machine language much lower-level than

programming language.

WHY JAVA Modern, modular (object-oriented) language. Good Error Detection. Rich Library Embodying Many Good

Programming Principles Can Write Teaching Tool (ObjectEditor)

JAVA VERSIONS, DIALECTS & PROGRAMMING ENVIRONMENT

JDK 1.5+ Eclipse IDE Programming Environment

top related