Introduction to Computer Programming

Slides:



Advertisements
Similar presentations
Introduction to Computer Programming
Advertisements

EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
4/23/2015Engineering Problem Solving with C++ second edition, J. ingber 1 Engineering Problem Solving with C++, Etter/Ingber Chapter 1.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Overview of Programming and Problem Solving ROBERT REAVES.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Introduction to Computers and Programming - Class 1 1 Introduction to Computers and Programming Professor Avi Rosenfeld.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
16 March, 2000 CS1001 Lecture 1 Introduction - Syllabus History of Computers Computer Components.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
CS102 Introduction to Computer Programming
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
CSCI 125 & 161 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk.
Chapter 1: Preliminaries. Objectives In this chapter, you will learn about: Unit analysis Exponential and scientific notations Software development Algorithms.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Introduction Lecture 01.
A First Book of ANSI C Fourth Edition
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.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
Programming Fundamentals1 Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING.
Software Basics. Some Pioneers Charles Babbage Analytical Engine Countess Ada Lovelace First Programmer ? John Von Neumann storing instructions in memory.
Chapter 1 Introduction.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Agenda Computer Languages How to Write a Simple C Program
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.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
1. an electronic device that manipulates information, or "data“
Chapter 1 An Overview of Computers and Programming Languages.
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
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.
Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department.
Chapter 1 Introduction 2nd Semester H
CSC235 Computer Organization & Assembly Language
Component 1.6.
CSCI 161: Introduction to Programming
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 – Introduction to Computers, the Internet, and the Web
Operating System Interface between a user and the computer hardware
CSCI-235 Micro-Computer Applications
Chapter 1: An Overview of Computers and Programming Languages
LESSON 1 Introduction to Programming Language
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Chapter 1: An Overview of Computers and Programming Languages
Computer System and Programming
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Unit# 8: Introduction to Computer Programming
Computer Science I CSC 135.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
Chapter One: An Introduction to Programming and Visual Basic
Text by: Lambert and Osborne
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1: Preliminaries
Programming Logic and Design Eighth Edition
Presentation transcript:

Introduction to Computer Programming Featuring: C language

What is computer? Computer is a device which can process data, perform computation and logical operations and gives output A computer performs the above using programs and without human intervention

History and Hardware Babbage’s analytical engine (1822) Atanasoff-Berry Computer (ABC, 1937) Human operator manipulated external wiring Electrical Numerical Integrator and Computer (ENIAC, 1946) Vacuum tubes Mark I (1944) Mechanical relay switches Electronic Delayed Storage Automatic Computer (EDSAC, 1949) Incorporated a form of memory

History and Hardware (continued)

Computer Hardware & Software Hardware – the physical devices of a computer Software – the programs or “intelligence” of the computer

Software Software – a group of programs Program – a specific set of instructions to the computer to perform a task Programmer – a person who writes a program

Computer Organization Input Unit Output Unit Memory Unit Arithmetic Logic Unit (ALU) Central Processing Unit (CPU) Secondary Storage unit

Components

Memory and data Memory unit: Area to store data and instructions Data stored as On or Off pulses

Data representation Represented by a combination of eight binary digits (1s and 0s) ASCII – American Standard Code for Information Interchange

ASCII representation From 00000000 to 11111111; each assigned to a unique character. An integer is stored in memory in its binary equivalence read as character using its ASCII character

ASCII Table

PROGRAMMING LANGUAGES

Programming Languages Computer program: data and instructions used to operate a computer and produce a specific result Programming: writing instructions in a language that the computer can respond to and that other programmers can understand Programming language: set of instructions that can be used to construct a program Source programs/Source code: Programs written in a computer language

Three General Types of Programming Languages: 1940s – Machine Languages A natural language of a computer, machine dependent the only language that can be understood and processed directly by computer 1950s – Symbolic/Assembly languages use of a series of mnemonics to represent commonly used instructions 1960s – High-Level Languages E.g. COBOL, FORTRAN, C, Java Note: Machine and assembly languages are low-level languages because they both use instructions that are directly tied to one type of computer

Machine Language Executable program: program that can operate a computer Executable programs are written with binary numbers, which is a computer’s internal language (machine language) An example of a simple machine language program containing two instructions is: 11000000000000000001000000000010 11110000000000000010000000000011 Opcode is short for operation code; tells the computer the operation to be performed

Assembly Language Assembly language: uses the substitution of word-like symbols for the opcodes, and decimal numbers and labels for memory addresses LOAD first ADD second MUL factor STORE answer

Assembly Language (continued)

Earlier high-level programming languages COBOL (Common Business Oriented Language) used primarily for business processing FORTRAN (Formula Translation) primarily perform mathematical calculations

Later High-Level Programming Languages PL/I, BASIC, Pascal, Prolog, C, Ada C++, Visual Basic HTML, Java

Writing, Editing, Compiling and Linking Programs Step1 – Write and edit programs Step2 – Compile programs Translate source file into machine language The output produced by the compiler is called an object program (machine language version of the source code) Step3 – Linking Programs - combines additional machine language code with the object program to create a final executable program

Writing, Editing, Compiling and Linking Programs

Procedural and Object-Oriented Languages Procedural language: instructions are used to create self-contained units, called procedures Procedure: accepts data as input and transforms it in some manner to produce a specific result as output Also called function or method Procedures conforming to structure guidelines are known as structured procedures

Procedural and Object-Oriented Languages (continued) Structured language: high-level procedural language (e.g., C) that enforces structured procedures Object-oriented languages: languages with object orientation such as C++, Java, Visual Basic, and C#

Procedural and Object-Oriented Languages (continued)

Structured programming A technique for organizing and coding computer programs in which a hierarchy of modules is used A disciplined approach in writing programs so that it is easier to test, debug and modify. Example: Pascal, Ada, C

History of C language Developed in the 1970s at AT&T Bell Laboratories by K. Thompson, D. Ritchie, and B. Kernighan Evolved from a language called B in the seventies at AT&T Bell labs First implemented on the UNIX operating system Written to help non-scientists develop computer programs High-level structured language Can also access the internal hardware of a computer C permits a programmer to “see into” a computer’s memory and directly alter data stored in it Standard maintained by the American National Standards Institute (ANSI) In the 1980s, Bjarne Stroustrup (working at AT&T) developed C++ C with object-oriented capabilities

The C language General purpose programming language Modern control flow and data structure Uses economy of expression Convenient and effective Useful for writing compilers and operating systems

Characteristic of C language Features structured programming Top-down: System overview -> Subsystem refined in detail Advantages of top-down programming: Separating the low level work from the higher level objects leads to a modular design. Modular design means development can be self contained. Having "skeleton" code illustrates clearly how low level modules integrate. Code is easier to follow, since it is written methodically and with purpose.

The Making of A Quality Program Readability understandable, with comments and documentations, using conventions like name of variables and indentations Modularity problems divided into sub-problems and assembled in a logical order Efficiency runs faster and smaller size of program

The Making of A Quality Program (cont.) Robustness Be able to handle all situations in a graceful manner Not to crash in unexpected situations or go to infinite loops Usability correct, meets the end-user requirement

Q & A