1 / 12

Introduction to Information and Computer Science

Introduction to Information and Computer Science. Computer Programming. Lecture b.

halil
Download Presentation

Introduction to Information and Computer Science

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Information and Computer Science Computer Programming Lecture b This material (Comp4_Unit5b), 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

  2. 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) Introduction to Information and Computer Science Computer Programming Lecture b

  3. Executing Programs • Computers execute machine code • Assemblers translate assembly language into machine code • Higher-level languages must be transformed into machine code Introduction to Information and Computer Science Computer Programming Lecture b

  4. Compiled Languages • Program written and stored in a file(s) • Compiler transforms the program into machine code • Machine code is stored in a new file and can be executed (clker.com, nd.); Blueprint image: (R. Thomas, 2001, PD-US) Introduction to Information and Computer Science Computer Programming Lecture b

  5. Compiled Languages, contd. • Each type of computer must have its own compiler • Every program must be compiled separately for each computer • Examples: C, C++, FORTRAN (clker.com, nd., PD-US); Apple logo: (EdibleKarma, 2008, PD-US); Blueprint image: (R. Thomas, 2001, PD-US) Microsoft windows logo: (clker.com, nd., PD-US) Introduction to Information and Computer Science Computer Programming Lecture b

  6. Interpreted Languages 0011010001011 • Interpreted languages are compiled and executed at the same time • Each line is compiled to machine code • If no errors, executes and goes to next line • If errors, program ends 1001011111010 (clker.com, nd., PD-US) Introduction to Information and Computer Science Computer Programming Lecture b

  7. Interpreted Languages, contd. • The interpreter is unique to each type of computer • Any program can be interpreted and run on any computer with an interpreter • Many scripting languages are interpreted • Examples: • BASIC, Perl, MUMPS (early version) Introduction to Information and Computer Science Computer Programming Lecture b

  8. Hybrid Approach • Some languages are compiled to virtual machine code, then interpreted to machine code • Combines speed of compiled language with portability of interpreted language • Examples: • Java™, Python Introduction to Information and Computer Science Computer Programming Lecture b

  9. Example: Java JVM • Java programs are compiled to byte code • The Java Virtual Machine (JVM) runs the byte code • JVM unique to each type of computer • Byte code is portable JVM (clker.com, nd., PD-US); Apple logo: (EdibleKarma, 2008, PD-US); Blueprint image: (R. Thomas, 2001, PD-US) Microsoft windows logo: (clker.com, nd., PD-US) Introduction to Information and Computer Science Computer Programming Lecture b

  10. Computer ProgrammingSummary – Lecture b • Compiling creates machine code from a program • Compilers are unique to each computer architecture • Interpreted programs are translated as they execute • Java uses a hybrid approach of compiling and interpreting Introduction to Information and Computer Science Computer Programming Lecture b

  11. Computer ProgrammingReferences – Lecture b References Morley Deborah, Parker Charles S. (2010). Chapter 13: Program Development and Programming Languages. In: Understanding Computers Today and Tomorrow.12th ed. Boston: Course Technology. 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 Mar 17 from Wikipedia: http://en.wikipedia.org/wiki/Programming_languages Scripting Languages. (2011). Retrieved 2011 Mar 21 from Wikipedia: http://en.wikipedia.org/wiki/Scripting_languages The Java Language: An Overview. [Webpage]. c 2007. [updated 2007 Dec 17; cited 21 March 2011]. Available from: http://java.sun.com/docs/overviews/java/java-overview-1.html Introduction to Information and Computer Science Computer Programming Lecture b

  12. Computer ProgrammingReferences – Lecture b Images Slide 4,5, 6, 9: Text document Image [image on the Internet]. c 2007 [Updated 11/13/2007; cited 11/12/2011]. Available from: http://www.clker.com/clipart-3709.html Slide 4,5, 9: Blueprint Image [image on the Internet]. c 2008 [Updated 12/7/2008; cited 11/12/2011]. Available from: http://commons.wikimedia.org/wiki/File:Architecture_framework.jpg Slide 4, 5, 9: Binary File Image [image on the Internet]. c 2010 [Updated 8/13/2010; cited 11/12/2011]. Available from: http://www.clker.com/clipart-binary-file.html Slide 4, 5, 6, 9: Computer Image [image on the Internet]. c 2010 [Updated 6/22/2010; cited 11/12/2011]. Available from: http://www.clker.com/clipart-computer-1.html Slide 5, 9: Apple Logo Image [image on the Internet]. c 2008 [Updated 2/27/2008; cited 11/12/2011]. Available from: http://wikimediafoundation.org/wiki/File:Light_Apple_Logo_Free.png Slide 5, 9: Microsoft Windows Logo Image [image on the Internet]. c 2007 [Updated 11/13/2007; cited 11/12/2011]. Available from: http://www.clker.com/clipart-7536.html Slide 9: Java cup Image [image on the Internet]. c 2007 [Updated 11/13/2007; cited 11/12/2011]. Available from: http://www.clker.com/clipart-3911.html Slide 9: Plain document Image [image on the Internet]. c 2007 [Updated 11/13/2007; cited 11/12/2011]. Available from: http://www.clker.com/clipart-3689.html Introduction to Information and Computer Science Computer Programming Lecture b

More Related