Computer Programming

32
Computer Programmin g Neal Alfie Y. Lasta Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

description

Computer Programming. Neal Alfie Y. Lasta. Table of Contents. What’s it All About? From your mind to the computer processor. I. What’s it all about?. Word processing. I. What’s it all about?. Slave. I. What’s it all about?. The quick brown fox jumps over the lazy d. - PowerPoint PPT Presentation

Transcript of Computer Programming

Page 1: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Computer ProgrammingNeal Alfie Y. Lasta

Page 2: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Table of ContentsI. What’s it All About?II. From your mind to the computer

processor

Page 3: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Word processingI. What’s it all about?

Page 4: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

SlaveI. What’s it all about?

Page 5: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

The quick brown fox jumps over the lazy d

I. What’s it all about?

Page 6: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Computer ProgramSet of instructions telling

computer what to do‘code’

I. What’s it all about?

Page 7: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

I. What’s it all about?

Page 8: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

I. What’s it all about?

Page 9: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Programmer!I. What’s it all about?

Page 10: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Gobs and gobs of codeI. What’s it all about?

Page 11: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Important programmer qualitiesThey know how to break big

problems into smaller step-by-step procedures

They can express these steps in a very precise language.

I. What’s it all about?

Page 12: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Computer Programming

Language for writing steps

Java C C++

I. What’s it all about?

Page 13: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Visual Basic

COBOL

ISETL

I. What’s it all about?

Page 14: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

II. From your mind to the computer processor

Page 15: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

3 important tools

Compiler VirtualMachine

ApplicationProgrammin

gInterface

Page 16: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

CompilerComputers deal with Zeros and

Ones

Start = 01010011 01110100 01100001 01110010 01110100

Page 17: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

CompilationTranslated Computer Program

into 0’s and 1’s

Source Code

Object Code

Page 18: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Relationship

Write Source Code

Create Object Code

Special Software tool - Compiler

Page 19: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Relationship

Computer’s hard drive -- > Javac or javac.exe

Page 20: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Virtual Machine

They’re just talking Gibberish! (-:

Page 21: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Computer “thinks” the thoughts

Bytecode file

Page 22: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

How Java does it

“Do What it Says to Do in the Bytecode File”

Page 23: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Java Virtual MachineSpecial Software

Computer JVM bytecode

Page 24: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Java Virtual Machine

Run •Java Program in computer

JVM •Java Virtual Machine

Examine •Bytecode, and carries

out instructions

Page 25: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

2 ways to run computer program

(a) Computer runs some object code

(b) Computer runs JVM, JVM follows bytecodes instructions

Page 26: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Application Programming Interface1980s

Word processing machines firm

Write

Search-and-replace program

Spell checker program

Another search-and-replace

Another spell checker

A better search-and-replace….

Page 27: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Holy Grail of ProgrammingEasy to reuse software

Searches for single character

Looks for blank spaces

Substitutes one letter for another

+ +

= Search and Replace Program

Page 28: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Adding new feature?Just Reassemble pieces in

different way◦-Sensible◦-Cost Efficient◦- Much more Fun!

Page 29: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Java came along in 19951995 Present

250 programs More than 3000 programs

Page 30: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

This library known asApplication Programming

Interface (API)API

Useful

Formidable

- All the things you can do with API programs

- API is so extensive

Page 31: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

API DocumentationProgrammers look of API Features in

online document called API Specification

A.k.a API Documentation, or JavadocsDescribes thousands of features in

Java APIDaily basis consultationBookmark website

Page 32: Computer  Programming

Lasta NAY. Teaching Demo. MSU-IIT IDS. 5/14/2010

Java Programming ToolsetJava CompilerJava Virtual MachineJava APIJava API Documentation

Also need: ◦Editor◦A way to issue commands

Compile program Run JVM