comp4 unit5a lecture slides

23
Introduction to Information and Computer Science Computer Programming Lecture a This material (Comp4_Unit5a) was developed by Oregon Health and Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number IU24OC000015..

Upload: health-it-workforce-curriculum-2012

Post on 06-May-2017

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Comp4 Unit5a Lecture Slides

Introduction to Information and Computer Science

Computer Programming

Lecture aThis material (Comp4_Unit5a) was developed by Oregon Health and Science University, funded by the Department of Health

and Human Services, Office of the National Coordinator for Health Information Technology under Award Number IU24OC000015..

Page 2: Comp4 Unit5a Lecture Slides

Computer ProgrammingLearning Objectives

• Define the purpose of programming languages. (Lecture a)

• Differentiate between the different types of programming languages and list commonly used ones. (Lecture a)

• Explain the compiling and interpreting process for computer programs. (Lecture b)

• Learn basic programming concepts including variable declarations, assignment statements, expressions, conditional statements and loops. (Lectures c, d)

• Describe advanced programming concepts including objects and modularity. (Lecture e)

2Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 3: Comp4 Unit5a Lecture Slides

Programming Languages

• Specify commands for a computer to perform– Syntax– Keywords– Punctuation

• Create programs• Pre-date computers

– Jacquard looms– Player pianos

3Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 4: Comp4 Unit5a Lecture Slides

Software• All software that runs on a computer is a

program – Written using a programming language– Many different languages available

• Software can be small programs or large, complex ones– Operating system– Word processing program– Simple utility

4Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 5: Comp4 Unit5a Lecture Slides

Software Development

• Creating software includes more than just writing the computer program

• Market analysis, requirements, and design specifications are important before starting to write programs

• Testing is important while writing• Support and maintenance are needed for the life

of the software

5Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 6: Comp4 Unit5a Lecture Slides

Software Development Stages

• Planning/exploratory phase• Analysis/requirements gathering• Design• Implementation• Testing• Deployment and maintenance

6Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 7: Comp4 Unit5a Lecture Slides

Prototyping

• Prototypes are initial versions of program used for feedback– Paper– Electronic, but not functional program– Functional program, but limited

• Can be done during any of the initial stages of development

• Good tool for keeping stakeholders involved

7Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 8: Comp4 Unit5a Lecture Slides

Software Development Methodology/Frameworks

• Frameworks describe process and structure of development– May include prototyping

• Development teams follow one methodology for development

• Some examples:– Waterfall method (Royce, 1971)– Spiral model (Boehm, 1986)– Rapid application development (Martin, 1991)

8Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 9: Comp4 Unit5a Lecture Slides

Algorithms

• Set of steps that define how a task is performed• The computer program implements an algorithm• Algorithm development occurred long before

computers!

9Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 10: Comp4 Unit5a Lecture Slides

Algorithm Example #1

• Making a peanut butter and jelly sandwich– Get the ingredients and tools– Spread peanut butter on one slice– Spread jelly on other slice– Place two slices together

10Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

(Evan-Amos, 2010, PD-US)

Page 11: Comp4 Unit5a Lecture Slides

Algorithm Example #2Making a peanut butter and jelly sandwich

– Get the ingredients and tools• Two slices of bread• Peanut butter• Jelly• Knife

– Spread peanut butter on one slice• Dip knife into peanut butter• Remove knife, bringing peanut butter with it• Place knife peanut butter side down on bread• Swirl knife to spread peanut butter

– Spread jelly on other slice– Place two slices together

11Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

(Evan-Amos, 2010, PD-US)

Page 12: Comp4 Unit5a Lecture Slides

Algorithm Uses• Describes problem solution without the

programming syntax– Pseudocode– Flowcharts

• Plan solution BEFORE programming• Can determine/prove

– Correctness– Time– Storage

12Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 13: Comp4 Unit5a Lecture Slides

Coding

• Programs/programming statements are also called code

• Writing programs is called coding• Choices for programming languages:

– Functionality of program– Where it will run– What is available

13Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 14: Comp4 Unit5a Lecture Slides

Categories of Programming Languages

Low-level languages:•First Generation

– Machine code (1s and 0s)•Second Generation

– Assembly language– Words describe commands

High-level languages:•Third Generation

– FORTRAN, BASIC, C, Java– Adds symbols to commands

•Fourth Generation– SQL– Powerful, complex commands

•Fifth Generation– Prolog, visual programming

14Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 15: Comp4 Unit5a Lecture Slides

First-GenerationMachine Code

• Each computer has an instruction set– Set of tasks computer can do– Unique sequence of 0s and 1s

• Applications are groups of instructions• Programmers used to program in 0s and 1s

– Switches– Punched cards

15Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 16: Comp4 Unit5a Lecture Slides

Second-Generation Assembly Language

• Use words to represent instructions

• Translate assembly code into machine code

• Unique to each computer, just as machine code is specific to each computer

.MODEL Small

.STACK 100h

.DATA db msg 'Hello, world!

$'.CODEstart: mov ah, 09h lea dx, msg ; or mov

dx, offset msg int 21h mov ax,4C00h int 21hend start

16Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 17: Comp4 Unit5a Lecture Slides

Third-Generation Languages

• The next generation of languages added operations – No longer unique to computer– Programs more portable

• Modern programming languages are third generation– FORTRAN, COBOL, C, C++, C#, Java,

VB.Net

17Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 18: Comp4 Unit5a Lecture Slides

Programming Paradigms• Procedural

– BASIC, COBOL, FORTRAN, C• Functional

– LISP, Scheme• Object-oriented languages

– C++, C#, Java, Ruby• Others

18Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 19: Comp4 Unit5a Lecture Slides

Scripting Languages

• Languages that control other applications– Batch control—shell scripts– Web browsers—javascript– Text processing—Perl

• Some have evolved for general application development– Perl, Python

19Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 20: Comp4 Unit5a Lecture Slides

Some Languages Specifically Designated for Health Care

• MUMPS (Massachusetts General Hospital Utility Multi-Programming System; Neil Pappalardo first developed in 1960s, standardized in 1977)

• MIIS (Proprietary implementation of MUMPS, 1969)

• MAGIC (MEDITECH Corp – founder N. Pappalardo, 1982)

20Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 21: Comp4 Unit5a Lecture Slides

Computer ProgrammingSummary – Lecture a

• Programming languages specify commands for programs to run

• Software is developed using a methodology• Algorithms are sequences of tasks• Programming languages may be high level or

low level • Programming languages have been developed

for healthcare

21Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 22: Comp4 Unit5a Lecture Slides

Computer ProgrammingReferences – Lecture a

References • Boehm B, (1986). "A Spiral Model of Software Development and Enhancement", ACM SIGSOFT Software

Engineering Notes, 11(4):14-24.• Meditech Magic Platform. [Webpage]. c 2007. [updated 2007 Jan 18; cited 2011 Nov 13]. Available from:

http://www.meditech.com/PublicRelations/pages/technologyMAGICOS.htm.• MIIS. (2011). Retrieved 2011 Nov 13 from Wikipedia:

http://en.wikipedia.org/wiki/MIIS_%28programming_language%29.• Morley Deborah, Parker Charles S. (2010). Chapter 13: Program Development and Programming Languages.

In: Understanding Computers Today and Tomorrow.12th ed. Boston: Course Technology.• MUMPS. (2011). Retrieved 2011 Mar 1 from Wikipedia : http://en.wikipedia.org/wiki/MUMPS.• Parsons JJ, Oja D. (2010). Chapter 12: Computer Programming. In: New Perspectives on Computer Concepts

2011: Comprehensive. 13th ed. Boston: Course Technology.• Programming Languages. (2011). Retrieved 2011 March 17 from Wikipedia:

http://en.wikipedia.org/wiki/Programming_languages.• Programming Paradigms. (2011). Retrieved 2011 Mar 14 from Wikipedia:

http://en.wikipedia.org/wiki/Programming_paradigms.• Rapid Application Development. (2011). Retrieved 2011 Nov 13 from Wikipedia:• http://en.wikipedia.org/wiki/Rapid_application_development.• Scripting Languages. (2011). Retrieved 2011 Mar 11 from Wikipedia :

http://en.wikipedia.org/wiki/Scripting_languages.• Software Development Methodology. (2011). Retrieved 2011 Nov 13 from Wikipedia:

http://en.wikipedia.org/wiki/Software_development_methodology.• Waterfall Model. (2011). Retrieved 2011 Nov 13 from Wikipedia: http://en.wikipedia.org/wiki/Waterfall_model.

22Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a

Page 23: Comp4 Unit5a Lecture Slides

Computer ProgrammingReferences – Lecture a

ImagesSlide 10, 11: Peanut Butter and Jelly Sandwich Image [image on the Internet]. Evan-Amos. (2010, November 11).

http://en.wikipedia.org/wiki/File:Peanut-Butter-Jelly-Sandwich.jpg. Retrieved January 2012, from Wikipedia website: http://en.wikipedia.org. (PD-US).

23Health IT Workforce Curriculum Version 3.0/Spring 2012

Introduction to Information and Computer Science Computer Programming

Lecture a