Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 

Slides:



Advertisements
Similar presentations
CS101: COMPUTER PROGRAMMING Lecture 1: Introduction to Computer and Programming.
Advertisements

EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Three types of computer languages
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
Chapter 1: An Overview of Computers and Programming Languages
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Chapter 2 Introduction to Systems Architecture. Chapter goals Discuss the development of automated computing Describe the general capabilities of a computer.
CHAPTER 1: Programming Fundamentals CSEB113 PRINCIPLES of PROGRAMMING by Badariah Solemon 1BS (May 2013)
CHAPTER 1: INTORDUCTION TO C LANGUAGE
1 Chapter-01 Introduction to Computers and C++ Programming.
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 1 Introduction.
Principles of Programming - NI July Chapter 1: Introduction In this chapter you will learn about: Overview of PC components The different types.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Introduction By: Dr. Javad Razjouyan. Programming Languages.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
CHAPTER 1 Overview of Programming and Problem Solving.
Introduction of C++ language. C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Chapter 1: An Overview of Computers and Programming Languages
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
CSEB114: Principle of Programming Chapter 1: Introduction to Computer and Programming.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
CHAPTER 1: Introduction to Computers and Programming CSEB113 PRINCIPLES of PROGRAMMING CSEB134 PROGRAMMING I by Badariah Solemon 1BS (May 2012)
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
 Getting ready to code Lecture 1 Match 4, Course syllabus 
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
Chapter 1 An Overview of Computers and Programming Languages.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Computer Software.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Chapter 1 Introduction 2nd Semester H
CSCI-235 Micro-Computer Applications
LESSON 1 Introduction to Programming Language
Instructor: Chien-Ho Ko
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
CHAPTER 1: Introduction to Computers and Programming
C++ Programming: From Problem Analysis to Program Design
Computer science By/ Midhat Mohiey. Introduction to Programming using C ++ 2.
TRANSLATORS AND IDEs Key Revision Points.
Introduction to Computer Programming
Computers: Hardware and Software
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CMP 131 Introduction to Computer Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Computer Programming
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming  The different types of language  Natural Language  Formal Language  Functional / Imperative Language  Programming Languages 1 NI S2 2009/10

Principles of Programming Overview of Computer Component  Computer Hardware  Computer Software 2

Principles of Programming Overview of Computer Hardware 3 Components of a PC Ordered sequence of storage location (memory cell)

Principles of Programming Overview of Computer Software  Operating System (OS)  the collection of computer programs that control the interaction of the user and the computer hardware.  Application Software  Programs developed to assist a computer user in accomplishing specific tasks.  E.g. Microsoft Word.  In order to create new application software, we need to write lists of instruction (program) to the computer to execute. 4

Principles of Programming What is Programming?  Programming is instructing a computer to do something for you with the help of a Programming Language  A programming language contains instructions for the computer to perform a specific action or a specific task:  Display “I like programming”  Display the current time 5

Principles of Programming  Programming language is different compared to our everyday-language (natural language); spoken and written  Does not have to be 100% correct but still understandable.  Depends on circumstances; the context: one word can have many meaning depending on the situation.  For example: PUNCH 6

Principles of Programming  Semantics – the meaning of the language within a given context  Syntax - Syntax are the rules to join words together in forming a correct expression or phrase.  In natural languages it is often possible to assemble a sentence in more than one correct ways. 7

Principles of Programming  Programming Language is a Formal Language used to communicate to a computer.  Very specific (one word means one thing – context free) since to 'talk' to a computer; to instruct a computer; our commands must be 100% clear and correct.  Either Functional - tell what to do but not how (sum [1...10])  or Imperative - describing the step by step to accomplish the task (Take the first number and add the next number to it; then add the next number to the sum; and …………; until you have reached 10 as number to be added. Then print the sum of all numbers) 8

Principles of Programming Programming Language  The two roles of a programming language:  Technical: It instructs the computer to perform tasks.  Conceptual: It is a framework within which we organize our ideas about things and processes.  In programming, we deal with two kind of things:  Data - representing 'objects' we want to manipulate  Procedures -'descriptions' or 'rules' that define how to manipulate data. 9

Principles of Programming Programming Language  Can be classified into a special-purpose and general- purpose programming languages.  Special-purpose : is design for a particular type of application  Structured Query Language (SQL)  General-purpose : can be used to obtain solutions for many types of problems.  Machine Languages  Assembly Languages  High-Level Languages 10

Principles of Programming Machine Language  The only language that the processor actually 'understands‘  Consists of binary codes: 0 and 1  Example:  Each of the lines above corresponds to a specific task to be done by the processor.  Programming in machine code is difficult and slow since it is difficult to memorize all the instructions.  Mistakes can happen very easily.  Processor and Architecture dependent (different machine language for different type of CPU) – not portable 11

Principles of Programming  Enables machine code to be represented in words and numbers.  Example of a program in assembly language: LOAD A, 9999 LOAD B, 8282 SUB B MOV C, A  Easier to understand and memorize (called Mnemonics), compared to machine code but still quite difficult to use.  Cannot be processed directly by a computer, must be converted to machine language using assemblers  Processor and Architecture dependent – not portable Assembly Language 12 LOAD A, 9999 LOAD B, 8282 SUB B MOV C, A LOAD A, 9999 LOAD B, 8282 SUB B MOV C, A Assembler

Principles of Programming High-Level Language  Machine independent programming language that combines algebraic expression and English words.  Example: c = b - a  Processor independent - the same code can be run on different processors.  Examples: Basic, Fortran, Pascal, Cobol, C, C++, Java  High level language needs to be translated (compiled) to machine code by a program called compiler so that it can be executed by the processor. 13

Principles of Programming 14 Entering, translating, and running a High-Level Language Program

Principles of Programming Integrated Development Environment (IDE)  A package that combines a simple word processor with a compiler, linker and loader. 15

Principles of Programming C Programming Language Why 'C' ?  Because based on 'B'; developed at Bell Laboratories  Developed by Dennis Ritchie at Bell Laboratories in the 1960s  In cooperation with Ken Thomson it was used for Unix systems  The C Language was only vaguely defined, not standardized, so that almost everyone had his own perception of it, to such an extend that an urgent need for a standard code was creeping up 16

Principles of Programming C Programming Language cont…  In 1983, the American National Standards Institute (ANSI) set up X3J11, a Technical Committee to draft a proposal for the ANSI standard, which was approved in 1989 and referred to as the ANSI/ISO 9899 : 1990 or simply the ANSI C, which is now the global standard for C.  This standard was updated in 1999; but there is no compiler yet 17

Principles of Programming C – An Imperative Language  C is a highly imperative formal language  We must tell it exactly how to do what;  the means and functions to use;  which libraries to use;  when to add a new line;  when an instruction is finished;  in short: everything and anything…  filename.c 18

Principles of Programming C++ Programming Language  Created by Bjarne Stroustrup at Bell Labroratories in early 1980s  Is an extension of the C language  C++ contains all features of C and new features (C++ a superset of C)  C++ makes object-oriented programming possible.  filename.cpp 19

Principles of Programming A Simple Program in C #include int main(void) { printf("I like programming in C.\n"); return (0); } 20

Principles of Programming A Simple Program in C - explanation #include int main(void) { printf("I like programming in C.\n"); return (0); } 21 standard Library, input-output, header-file Beginning of the program End of statement End of Segment Start of Segment Function for printing text Insert a new line

Principles of Programming C Output I like programming in C. 22

Principles of Programming Summary  We have seen some different types of languages;  the relevance of semantics and syntax.  We have observed the detail necessary in an imperative language to instruct a computer properly.  Finally, we examined the syntax to print a line of text to the screen of our computer. 23