Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.

Slides:



Advertisements
Similar presentations
C Programming Technique – Firdaus-Harun.com
Advertisements

CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
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.
Chapter 2- Visual Basic Schneider
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
CIS105 Chapter 1 Theory Review. Page 2 Hardware and Software are the two major components o any computer system Hardware is the set of physical devices.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
The Program Design Phases
An Overview of Computers and Programming
Review Algorithm Analysis Problem Solving Space Complexity
PRE-PROGRAMMING PHASE
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
CSC141 Introduction to Computer Programming
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Software Life Cycle What Requirements Gathering, Problem definition
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Algorithms & Flowchart
Dale Roberts 1 Program Control - Algorithms Department of Computer and Information Science, School of Science, IUPUI CSCI N305.
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 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
1 Program Planning and Design Important stages before actual program is written.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Programming Logic and Design Seventh Edition
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Algorithms and Pseudocode
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Algorithms and Flowcharts
Pseudocode (pronounced SOO-doh-kohd)  is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled.
Chapter 1 Introduction 2nd Semester H
Programming Languages
Unit 3: ALGORITHMS AND FLOWCHARTS
CSCI-235 Micro-Computer Applications
Computer Programming.
Chapter 2- Visual Basic Schneider
Lecture 2 Introduction to Programming
Program Control using Java - Theory
(Course Introduction)
Chapter 2- Visual Basic Schneider
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 2- Visual Basic Schneider
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.
CS105 Introduction to Computer Concepts Intro to programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Introduction to Programming Lecture Number:

What is Programming Programming is to instruct the computer on what it has to do in a language that the computer understands. Programming must be done in a programming language, most preferably it should be the binary language as computers work on 1’s and 0’s which is called machine or some times ‘object’ code.

Machine Code An example machine code could be: (Add two numbers) (Subtract two numbers) (Multiply two numbers) It clearly is not memorisable or understandable by the human being so we need an alternative!

Assembly Language As an alternative the binary sequences of numbers were represented by simple english keywords: (ADD) (SUB) (MUL) This is relatively easier as compared to the machine language, however modern applications need much higher levels of abstraction.

The need for High level languages ADD,SUB, MUL etc are usually limited to a specific maximum number of bits, we need generic coding schemes where we can concentrate on the logic instead of memory constraints. ADD might be SUM or ADDA in other machines, we needed a machine and platform independent solution so a single language could suffice for all machines.

High-level Languages High level languages came into being solving various glitches that machine and assembly languages had. Examples of high-level languages are: C++, Java, Visual Basic, Visual C#, etc However, High level languages are not understandable by the machines so we need an interpreter, also called a compiler.

Compiler A compiler is a piece of software that translates high level language into machine or binary code. Every language has a specific style or way, called its syntax, just like there’s grammar in human languages. Compiler also checks for any syntax errors in our ‘code’.

The Compile process Programmer Writes High-level Code Compiler checks for code validity Translated to machine code

Examples of Compilers Microsoft Visual Studio Borland C++ Bloodshed Dev C++

What happens after compiling? Once the object-code/Machine-code is generated, another process called ‘Linking’ is done, which means to link any pre-available libraries with our code. A library is a collection of modules or functions made by other programmers for later reuse. Different languages have different ways of expressing libraries, like in C++ they’re represented by.lib extension.

What happens after Linking? Loading! The program after linking is put into Main Memory (RAM). Execution is the next step The RAM acts like a conveyer belt for the processor which actually executes the code.

Definition of Algorithm (after Al Kho-warizmi a 9th century Persian mathematician) - an ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this definition more closely an ordered sequence means that you can number the steps (it's socks then shoes!) unambiguous and well-defined instructions means that each instruction is clear, do-able, and can be done without difficulty performs some task halts in finite time (algorithms terminate!)

Building the Program Logic Before writing a program, we need to plan the flow of the program Pseudo-code and flow-charts are two general tools that help in planning for a program

Pseudo-code & Flow Charts Pseudo-code – Informal language used to develop algorithms – Similar to a Natural Language – Not actually executed on computers – Allows us to “think out” a program before writing the code – Easy to convert into a program

Computing Sales Tax Example #1 - Pseudo-code the task of computing the final price of an item after figuring in sales tax. Note the three types of instructions: input (get),process/calculate (=) and output (display) 1.get price of item 2. get sales tax rate 3. sales tax = price of time times sales tax rate 4 final prince = price of item plus sales tax 5. display final price 6. halt Variables: price of item, sales tax rate, sales tax, final price

Pseudo-code & Flow Charts Flow Charts – Flow Charts are a graphical representation, usually considered more understandable – Drawn using certain special-purpose symbols, as described next

Pseudo-code & Flow Charts Oval symbol OR small circle – indicates beginning or end of a program, or a section of code Arrows called flow-lines – Indicate the flow of program

Pseudo-code & Flow Charts Rectangle symbol (action symbol) – Indicates any type of action. Diamond – Indicates Decision add grade to total grade >= 60

Today we studied What is Computer Programming? Machine, Assembly and High-Level language Compilers The program planning process