Programming Languages CPS120: Introduction to Computer Science Lecture 5.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
How Are Algorithms Developed?
Chapter 3: Modularization
Computers Are Your Future
Programming Logic and Design Fourth Edition, Introductory
Introduction to Programming
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
1 ) Definition 2) Note on structured and modular programming, and information hiding 3) Example imperative languages 4) Features of imperative languages.
Computers Are Your Future © 2006 Prentice Hall, Inc.
Computers: Tools for an Information Age
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
CS102 Introduction to Computer Programming
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Introduction to Computer Programming itc-314
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Chapter 1: Preliminaries. Objectives In this chapter, you will learn about: Unit analysis Exponential and scientific notations Software development Algorithms.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
An Introduction to Programming with C++ Sixth Edition
CS101 Introduction to Computing Lecture Programming Languages.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Prof. Ken Regis Institute for Computer Engineering Florida State University Oktober 2002Prof. Ken Regis - FIT 1-11.
Programming Languages
Programming and Languages Dept. of Computer and Information Science IUPUI.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Course Instructor: Hira Farman Course : BY:HIRA FARMAN.
CONCEPTS OF PROGRAMMING LANGUAGES
Introduction to Language Programming Hierarchy of programming lang. Based on machine independences: 1. Machine language 2. Assembly language 3. Higher.
Introduction to Computer Programming itc-314 Lecture 04.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Introduction to Programming Languages © 2005 Prentice Hall, Inc. CXC IT Unit 2: Intro. to Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Programming Languages
Introduction to programming languages, Algorithms & flowcharts
CSCI-235 Micro-Computer Applications
Computer Programming.
Programming Concepts and Languages
Developing Applications
Introduction to programming languages, Algorithms & flowcharts
(Course Introduction)
Introduction to Computer Programming
Overview of Programming Paradigms
An Introduction to Programming with C++ Fifth Edition
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

Programming Languages CPS120: Introduction to Computer Science Lecture 5

Programming Languages  A programming language is a set of rules that provides a way of telling a computer what operations to perform.

Levels of Programming Languages  Machine language  Assembly Language  High Level Languages  Fourth Generation Languages (4GL)

Machine Languages  different for each computer processor

Assembly Languages  different for each computer processor mainproc pay mov ax, dseg mov ax, 0b00h add ax, dx mov a1, b1 mul b1, ax mov b1, 04h

High-Level Languages  Higher Level Languages Use traditional programming logic where the programming instructions tell the computer what to do and how to perform the required operations.  4GLs Use high-level English-like instructions to specify what to do, not how to do it.

Interpreter vs. Compiler  Interpreter Translates instructions to machine code line-by-line.  Compiler Translates the entire program to machine code before running it.

Types of Programming Languages  Machine language  Procedure-oriented languages  Object-oriented languages  Event-driven languages

Early Language History  FORTRAN (short for Formula Translator, developed in the 1950s by IBM  In 1958, a language called ALGOL (Algorithm Language) was developed  COBOL (Common Business Oriented Language) was created in 1960 to serve as the primary language for large-scale programs  In 1964, the BASIC language (Beginners All-Purpose Symbolic Instruction Code) was first used  In 1965, a language called PL/I was developed in hopes of being everything to everyone.  PL/I proved to be too complex.  In the late 1960s, Niklaus Wirth developed a teaching language called Pascal.

Later Language History  Ada, which was developed in 1983, is large and complex.  Smalltalk is graphical and object-oriented. Concepts developed with Smalltalk were important to the development and continued development of languages like C++ and Java  The C language was derived from ALGOL.  C++ is C with the addition of object-oriented concepts.

Procedure-Oriented Languages  FORTRAN  COBOL  Pascal  C  Ada

OOED Languages  Object-oriented languages Smalltalk C++ Ada 95  Event-driven languages Visual Basic most Visual languages

What Can a Program Do?  A program can only instruct a computer to: Read Input Sequence Calculate Store data Compare and branch Iterate or Loop Write Output

Fundamental Programming Concepts  Assignment of values to a variable  Iteration (Looping) Over a set of set of statements With respect to a logical expressions (conditions)  Delegation of sub-tasks to functions / procedures

The Structure Theorem The Structure Theorem states that any algorithm can be built from three basic control structures.  One-after-another (Sequence)  Decision-making (Selection) Making choices between 2 or more alternatives  Repetition (Iteration) Concerned with repetitive tasks (and the termination conditions of loops)

C++ Control Structures 1. "Sequence statements" are imperatives 2. "Selection" is the "if then else" statement – AND, OR, NOT and parentheses ( ) can be used for compound conditions 3. "Iteration" is satisfied by a number of statements – "while" – " do " – "for" 4. The case-type statement is satisfied by the "switch" statement. – CASE statements are used for most non-trivial selection decisions

Programmer Productivity Tools  Modular Programming  Structured Programming  Object-oriented Programming

Modular Programming  Large programs are divided by functional parts into subroutines Strong cohesion Loose coupling

Structured Programming  Composed of sequence, decision (selection), and repetition (looping or iteration) structures  Structured program languages lend themselves to flowcharts, structure charts, and pseudocode.  Structured programming languages work best where the instructions have been broken up into small, manageable parts.  Looks at a problem as procedures Data are maintained separately from data

Structured Program Rules 1. Use only sequence, decision, and repetition 2. Only one entrance into and one exit from a structure 3. Connectors only allowed when continuing processing from one column or page to another 4. Decision and repetition structures can be nested 5. Only one STOP instruction is permitted. It must be in the MAINLINE routine

Structured Programming Advantages  Standard method for solving problems  GO-TO less  Easier to test and debug  Written by more than one programmer  Reusability  Thrashing minimized

Object-Oriented Programs  Developed to respond to programming issues that structured programming did not adequately address 1. Rarely possible to anticipate the design of a completed system before implementation 2. GUIs were difficult to develop in traditional procedure- oriented languages 3. Sharing data across routines is error prone Information hiding allows programmers to determine what data is exposed to various routines