1 Chapter-01 Introduction to Computers and C++ Programming.

Slides:



Advertisements
Similar presentations
GCSE Computing Lesson 5.
Advertisements

Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
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.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
Introduction to Programming End Show. Resource Team R.P Ranjan-Lecturer, SPICTEC, Galle. W.M.A.S. Wijesekara-Centre manager,CRC Hali-Ela H.P.U.S Indra.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Course Introduction C++ An Introduction to Computing.
High-level Languages.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Standard Grade Computing SYSTEM SOFTWARE CHAPTER 19.
Slide 1 Standard Grade Computing Studies Systems Software.
Laboratorio di Calcolo I Docente: prof. Berardi (Dip. Informatica) Lezione introduttiva su Computing ed esercitazioni di Unix/Linux tenute da Fabrizio.
Introduction CS 104: Applied C++ What is Programming? For some given problem: __________ a solution for it -- identify, organize & store the problem's.
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
1 CPSC 185 Introduction to Computing The course home page
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
PROGRAMMING LANGUAGES
1 3. Computing System Fundamentals 3.1 Language Translators.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Introduction 1 (Read Chap. 1) What is Programming? For some given problem: design a solution for it -- identify, organize & store the problem's data --
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
Computer Programming Languages HOW COMPUTERS WORK èCIRCUITS èBINARY DIGIT èBIT (0 OR 1) èBYTE - 8 BITS èASCII.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Compilers and Interpreters. HARDWARE Machine LanguageAssembly Language High Level Language C++ Visual Basic JAVA Humans.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Programming and Languages Dept. of Computer and Information Science IUPUI.
By ILTAF MEHDI 1 COURSE TITLE: FUNDANENTALS OF PROGRAMMING INSTRUCTOR: ILTAF MEHDI.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
Compilers and Interpreters
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Introduction to Computer Programming using Fortran 77.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Computer Software.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Programming Languages
Software Engineering Algorithms, Compilers, & Lifecycle.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 0: Historical Overview.
INTRODUCTION TO COMPUTER PROGRAMMING ITC-314. Computer Programming  Computer Programming means creating a sequence of instructions to enable a computer.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Evolution and History of Programming Languages
Computer Basics.
Computer Systems Nat 5 Computing Science
Introduction to programming
Operating System Interface between a user and the computer hardware
Lecture 1 Introduction Richard Gesick.
Programming Language Hierarchy, Phases of a Java Program
CSCI-235 Micro-Computer Applications
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Computer Systems Nat 5 Computing Science
Programming Languages and Translators
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
CMP 131 Introduction to Computer Programming
Programming.
Programming Languages
ICT Programming Lesson 1:
Presentation transcript:

1 Chapter-01 Introduction to Computers and C++ Programming

2 Who are we? Programmers

3 What make us programmers? People who write programs are called programmers.

4 What is a Program? A sequence of statements that instruct a computer in how to solve a problem is called a program. Statment 1 Statment 2 Statment 3...

5 What is Programming? It is the process of planning a sequence of steps (called instructions) for a computer to follow. STEP 1 STEP 2 STEP 3... The act of designing, writing and maintaining a program is called programming.

6 What kinds of statements do computers understand? A computer only understands machine language statements. A machine language statement is a sequence of ones and zeros that cause the computer to perform a particular action, such as add, subtract, multiply, … e.g,, Add two numbers

7 Machine Language (ML) ML statements are stored in a computer’s memory, which is a sequence of switches. For convenience of representation, an “on” switch is represented by 1, and an “off” switch is represented by 0. ML thus appears to be binary (base-2): e.g,Add two numbers

8 Lets see more about Computers Chapter_01_2_Computer_Organization.ppt

9 Back to Programming Chapter_01_1_Programming_and_Languages.ppt

10 Machine Language is not portable runs only on specific type of computer is made up of binary-coded instructions (strings of 0s and 1s) is the language that can be directly used by the computer

11 Early Computers... required a programmer to write in machine language (ML)... –Easy to make mistakes! –Such mistakes are hard to find! –Not portable -- only runs on one kind of machine! (CPU) Programming was very difficult!

12 A Bright Idea Devise a set of abbreviations (mnemonics) corresponding to the ML statements, plus a program to translate them into ML. The abbreviations are an assembly language, and the program to translate them into machine language is called an assembler. Assembler ADD

13 Assembly Languages Allowed a programmer to use mnemonics, which were more natural than binary numbers. +Much easier to write programs +Much easier to read programs +Much easier to find and fix mistakes –Still not portable to different machines

14 Assembly Language (middle level) a more or less human readable version of machine language words, abbreviations, letters and numbers replace 0s and 1s easily translated from human readable to machine executable code like machine code, not portable (hardware dependent)

15 Devise a set of statements that are close to human language (if, while, do,...), plus a program to translate them into ML. The set of statements is called a high level language (HLL) and the program to translate them into machine language is called a compiler. High Level Languages

16 HLL Compilers Where an assembler translates one mnemonic into one ML statement, a HLL compiler translates one HLL statement into multiple ML statements. Compiler z = x + y;

17 HLLs High level languages (like C++) are +Much easier to write programs +Much easier to read programs +Much easier to find and fix mistakes +Portable from one machine to another (so long as they keep to the language standard).

18 High Level Languages are portable user writes program in language similar to natural language examples -- FORTRAN, COBOL, Pascal, Ada, Modula-2, C++, Java most are standardized by ISO/ANSI to provide an official description of the language

19 High Level Languages

20 Interpreters Interpreters - another way to translate HLL to machine language or object code –interpretation (from source to object code) is not a separate user step –translation is “on-line,” i.e. at run time Interpreter High Level Language machine language

21 Compilers vs. Assemblers vs. Interpreters Compilers and Assemblers –translation is a separate user step –translation is “off-line,” i.e. not at run time Interpreters - another way to translate source to object code –interpretation is not a separate user step –translation is “on-line,” i.e. at run time Assembler Assembly Language Machine Language Compiler, or Interpreter High Level Language Machine Language

22 Compilers vs. Interpreters Compiled programs execute faster than interpreted programs Interpreters are popular in program development environments in which programs are recompiled frequently as new features are added and errors are corrected. Once a program is developed, a compiled version can be produced to run most efficiently.

23 Where we use Interpreters? Java virtual machine

24 Objectives in Programming A program should solve a problem: +correctly (it actually solves the problem) +efficiently (without wasting time or space) +readably (understandable by another person) +in a user-friendly fashion (in a way that is easy for its user to use).

25 Running a Program Program Computer Processing Data Data input (input for the program) Data Output (Output of the program)

26 Running a Program Data Output ( output for the program) Program Data Input (input for the program) Computer, Processing Data

27 Summary There are “levels” to computer languages: –ML consists of “low” level binary statements, that is hard to read, write, and not portable. –Assembly uses “medium” level mnemonics: easier to read/write, but not portable. –C++ is a “high” level language that is even easier to read/write, and portable.