Intro to Programming Week # 1 Hardware / Software Lecture # 2

Slides:



Advertisements
Similar presentations
EC-111 Algorithms & Computing Lecture #1 Instructor: Jahan Zeb Department of Computer Engineering (DCE) College of E&ME NUST.
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Introduction to Programming Lecture 2. Today’s Lecture Software Categories Software Categories System Software System Software Application Software Application.
Three types of computer languages
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
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.
 2003 Prentice Hall, Inc. All rights reserved. 1 Machine Languages, Assembly Languages, and High-level Languages Three types of computer languages 1.Machine.
C programming Language and Data Structure For DIT Students.
1 CHAPTER 4 LANGUAGE/SOFTWARE Hardware Hardware is the machine itself and its various individual equipment. It includes all mechanical, electronic.
 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
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
Programming Design Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Spring 2005, Gülcihan Özdemir Dağ BIL104E: Introduction to Scientific and Engineering Computing, Spring Outline 1.1Introduction 1.2What Is a Computer?
Five Tips to Success. Work hard Try more exercises and more practice.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Computer Organization Six logical units in every.
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice:
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introduction to Computers Outline 1.1Introduction.
Introduction to Programming Lecture No. 1. Books  Deitel & Deitel :– C++ How to Program  Kernighan and Ritchie:- The C Programming Language.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 1 February 8, 2005.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
What is C? C is a programming language. It was developed in 1972 USA. It was designed and written by a man named dennis ritchie. C is the base for all.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CS-303 Introduction to Programming
Programming Fundamentals Lecture No. 2. Course Objectives Objectives of this course are three fold 1. To appreciate the need for a programming language.
CHAPTER 1.1 INTRODUCTION TO COMPUTERS AND C++ Dr. Shady Yehia Elmashad.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 1 – Introduction to C.
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
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.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Structured programming 1 st stage By Heba.A Raheem Assist Lecturer College of Sciences/Computer Sciences Department.
Chapter 1 Introduction 2nd Semester H
 2001 Prentice Hall, Inc. All rights reserved.
Chapter 1: Introduction to computers and C++ Programming
1.2 What is a Computer? Computer Computer programs Hardware Software
Outline Introduction What Is a Computer? Computer Organization
Lecture 1: Introduction to JAVA
© by Pearson Education, Inc. All Rights Reserved.
Computer Programming (CS-161)
Introduction to Programming
Instructor: Chien-Ho Ko
C Language VIVA Questions with Answers
Chapter 1 – Introduction to Computers and C++ Programming
CS1123 Computer Programming Spring 2012 Instructor Ghufran Ahmed.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Java programming lecture one
Chapter 1: An Overview of Computers and Programming Languages
1.6 Machine Languages, Assembly Languages, and High-level Languages
' C ' PROGRAMMING SRM-MCA.
C++ Programming: From Problem Analysis to Program Design
Chapter 1: Introduction to Computers and Programming
Introduction to C Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Outline Introduction What Is a Computer? Computer Organization
Chapter 1 – Introduction to Computers and C++ Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
C programming Language
Introduction to Computer Programming
Chapter 1 – Introduction to Computers and C++ Programming
Chapter 1 Introduction to Programming
Basic Programming Lab C.
Chapter 1 Introduction.
Programming Fundamentals Lecture #2 Overview of Computer Programming
Chapter 1 – Introduction to Computers and C++ Programming
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Intro to Programming Week # 1 Hardware / Software Lecture # 2 Department of Computer Science & Engineering Air University Intro to Programming Week # 1 Hardware / Software Lecture # 2 By: Saqib Rasheed

Computers Have Two Main Parts Computer Hardware Computer Software

What is Computer Hardware? Computer Hardware is the physical part of the computer system, the machinery and equipment

Computer Software's Computer Software are programs that tell the computer what to do.

What is a Computer? Computer Hardware Software Device capable of performing computations and making logical decisions Computers process data under the control of sets of instructions called computer programs Hardware Various devices comprising a computer Keyboard, screen, mouse, disks, memory, CD-ROM, and processing units Software Programs that run on a computer

How to Communicate with computer? Computer understands its own machine language (language of 0s and 1s). Language instructs computer to perform tasks. We need to understand computer’s language to communicate with it and to make it perform our desired functions. So we have….

Programming Language Set of rules and symbols used to construct a computer program A language used to interact with the computer

Machine Languages, Assembly Languages, and High-level Languages Three types of programming languages Machine languages Strings of numbers giving machine specific instructions Example: +1300042774 +1400593419 +1200274027 Assembly languages English-like abbreviations representing elementary computer operations (translated via assemblers) LOAD BASEPAY ADD OVERPAY STORE GROSSPAY

Machine Languages, Assembly Languages, and High-level Languages Three types of programming languages (continued) High-level languages Codes similar to everyday English Use mathematical notations (translated via compilers) Example: grossPay = basePay + overTimePay

What is C C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. Influenced by ALGOL 60 (1960), CPL (Cambridge, 1963), BCPL (Martin Richard, 1967), B (Ken Thompson, 1970)

What is C….. Used to develop UNIX Used to write modern operating systems Hardware independent (portable) C began to replace the more familiar languages of that time like PL/I, ALGOL, etc Because it is reliable, simple and easy to use.

Steps in C/C++

The C++ Character Set A character denotes any alphabet, digit or special symbol used to represent information. We have 32 special symbols

Constants, Variables and Keywords The alphabets, numbers and special symbols when properly combined form constants, variables and keywords. A constant is an entity that doesn’t change. Whereas a variable is an entity that may change.

Types of C Constants C++ constants can be divided into two major categories: Primary Constants Secondary Constants These constants are further categorized as shown in Figure

Program Errors Syntax errors Related to the error in grammar/syntax of a language Run time errors during execution indicate bugs example: un-handled exceptions, memory overrun. Logical errors Bug in program that causes program to operate incorrectly, but not terminate.

Tools of the trade Editor Interpreter and Compilers Debuggers

Integrated Development Environment (IDE) It contains Editor Compilers Debugger Linkers Loaders

Loader puts program in memory. Preprocessor program processes the code. Loader puts program in memory. CPU takes each instruction and executes it, possibly storing new data values as the program executes. Compiler creates object code and stores it on disk. Linker links the object code with the libraries Loader Primary Memory Compiler Editor Preprocessor Linker   . Disk CPU Program is created in the editor and stored on disk.