ITEC113 Algorithms and Programming Techniques

Slides:



Advertisements
Similar presentations
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
Advertisements

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.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Programming Creating programs that run on your PC
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
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
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
Computers & Logic An Overview. Hardware Hardware is the equipment, or the devices, associated with a computer. For a computer to be useful, however, it.
ITEC113 Algorithms and Programming Techniques Introduction to Programming.
Introduction to Computers and Programming
1 6 Abacus An early device to record numeric values Blaise Pascal Mechanical device to add, subtract, divide & multiply Joseph Jacquard Jacquard’s Loom,
CS102 Introduction to Computer Programming
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
EKT150 INTRODUCTION TO COMPUTER PROGRAMMING
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Programming Lifecycle
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 1 February 8, 2005.
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: 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.
Programming Fundamentals1 Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
1 MIS 131 Introduction to Algorithms and Programming 2015/2016 Fall - Chapter 1 -
1 Programming Fundamentals How to Program in C++ How to Program in C++
COMPUTER PROGRAMMING. Computer programming the objective of the module to gain the necessary skills to develop a computer program using one of the high.
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.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CS2301:Computer Programming 2
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
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.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
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.
Chapter 1 Introduction 2nd Semester H
EKT150 INTRODUCTION TO COMPUTER PROGRAMMING
Operating System Interface between a user and the computer hardware
CSCI-235 Micro-Computer Applications
Computer Programming.
DDC 1023 – Programming Technique
Chapter 2- Visual Basic Schneider
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 2 Introduction to Programming
C++ Programming: From Problem Analysis to Program Design
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
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
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
ICT Gaming Lesson 2.
Programming Logic and Design Eighth Edition
Presentation transcript:

ITEC113 Algorithms and Programming Techniques Introduction to Programming

What is a computer Computer Hardware Software is a device that receives input, stores and processes data, and provides output in a useful format. Computers process data according to sets of instructions called computer programs Example: laptops, PCs, mainframes, even everyday objects such as mobile phones, washing-machines, TV sets, cars contain computers Hardware Physical components of a computer Example: Keyboard, screen, mouse, disks, memory, CD-ROM, and processing units Software Programs that run on a computer Example: Operating System such as windows XP and Vista, Word processing packages such as MS Word, registration program ITEC113 Lecture Notes 1

What is a computer? Computers are NOT intelligent or telepathic Computers do what we tell them to do they don’t do anything by themselves. We must clearly tell a computer what to do in a step by step manner using a programming language. Computers speed “electronic” => high voltage/low voltage Machine language is binary (two values: high/low) ITEC113 Lecture Notes 1

Why we are using Computers? Computers produce fast, accurate and reliable results. While computers do the boring, repetitive, ordinary tasks, we can spend our efforts and time to work on more interesting and creative tasks. The use of computers in business and manufacturing decreases the cost of goods and services produced. It is more difficult and needs more time to find or grow up a skillful labor in industry, while buying an additional computer and installing the required software on is easier and cheaper. ITEC113 Lecture Notes 1

Need for Programming Computers are just electronic devices that have the power to perform difficult tasks but they do not ‘KNOW’ what to do. Programmers tell the computers what to do by writing programs ITEC113 Lecture Notes 1

Types of Programming languages Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example: +1300042774 +1400593419 +1200274027 ITEC113 Lecture Notes 1

Types of Programming languages Three types of programming languages (continued) 2. Assembly languages English-like abbreviations representing elementary computer operations (translated via assemblers) Example: LOAD BASEPAY ADD OVERPAY STORE GROSSPAY ITEC113 Lecture Notes 1

Types of Programming languages Three types of programming languages (continued) 3. High-level languages Codes similar to everyday English Use mathematical notations (translated via compilers) Example Code: grossPay = basePay + overTimePay Example high level languages: C, C++, Cobol, Java, Pascal (Delphi), Basic (Visual Basic) Fortran, SQL, T-SQL, C# … ITEC113 Lecture Notes 1

What is Data, Information and Knowledge ? Data are the raw facts, gathered from the environment which does not have much meaning. Note: Data is plural, singular form is Datum. Information is the end product of the processing of data, which has more meaning, and is used in decision making. Knowledge is the proved and generalized form of information, that is used in strategic planning. Data is raw material for data processing. data relates to fact, event and transactions. Information is data that has been processed in such a way as to be meaningful to the person who receives it. it is any thing that is communicated. for example: researchers who conduct market research survey might ask member of the public to complete questionnaires about a product or a service. These completed questionnaires are data; they are processed and analyze in order to prepare a report on the survey. This resulting report is information. THAT'S ALL ITEC113 Lecture Notes 1

What is Data, Information and Knowledge ? ITEC113 Lecture Notes 1

What is a Computer Program? A computer program is a set of instructions written in a computer language executed to perform a specific task. Also called SOFTWARE There are tens of programming languages, used nowadays. C, C++, C#, Pascal, Delphi, Visual Basic, Java, COBOL, FORTRAN, LISP, Prolog … ITEC113 Lecture Notes 1

Who is a Programmer? A programmer is a person who writes the required computer programs. Programmers translate the expected tasks given in a form we can understand into a form machines can understand Register students in EMU Registration program written in Delphi ITEC113 Lecture Notes 1

Types of Errors Syntax Errors: Violation of syntactic rules in a Programming Language generates syntax errors. Effect? Compiler helps user to identify the Syntax error and correct it Semantic Errors: Doing logical mistakes causes semantic errors . Effect? The Compiler can not notice these errors, but on execution, they cause unexpected wrong results. These errors can only be corrected by the careful programmer Run-time Errors: Occur on program execution. Mostly caused by invalid data entry or tries to use not existing resources. ( E.g. Attempting to divide a number by 0 ) Effect? It occurs on run time and may crash the program execution. ITEC113 Lecture Notes 1

Properties of Well Designed Programs Well designed programs must be: Correct and accurate Easy to understand Easy to maintain and update Efficient Reliable Flexible ITEC113 Lecture Notes 1

Steps involved in Programming Requirement Specification: eliminate ambiguities. Clearly understand the problem Analyze the problem : Understand the inputs, outputs and processes used for manipulating the data, formulas and constraints Design: Write the algorithm (flowchart or pseudocode) to represent the solution Testing and verification : Check the algorithm. Implement the algorithm : Write a program Testing and Verification: Check the program Documentation ITEC113 Lecture Notes 1

What is an Algorithm? An algorithm is the plan for writing a program. Steps required for solving a problem are listed by using an algorithm tool. Algorithm tools make program solutions more clear, more understandable, and easier to remember. Algorithms are written according to rules so that other programmers are also able to read and understand the solution easily. ITEC113 Lecture Notes 1

Tools of Algorithms There are many Algorithm tools in use, but the most popular ones are Flowcharts and Pseudo-Codes. In this course for all problems we will use both of these tools but in general you choose only one. ITEC113 Lecture Notes 1

Flowcharts Flowcharts are graphical tools, containing a set of shapes, each expressing a different action in a sequence of program execution. There are many different shapes that are used for specific purposes, to avoid complexity, in this course, only a limited subset of these shapes will be shown and used in applications. ITEC113 Lecture Notes 1

Flowcharting Shapes Start End Every flowchart has to start with a TERMINAL shape containing the caption START and has to end with another TERMINAL shape containing the caption of END. INPUT shape is used to indicate manual input or reading values from keyboard. OUTPUT shape is used to indicate producing printed output to the user. DISPLAY shape is used to indicate that a value is sent to the monitor. Student Id Student Transcript cgpa ITEC113 Lecture Notes 1

Flowcharting Shapes PROCESS shape is used to represent assignments and manipulations of data such as arithmetic operations. DECISION shape represents the comparison of two values. Alternating course of actions is followed depending on the result of the criteria. CONNECTOR symbol is used to show the connections of two pages, when your design occupies more then one page. Also used to collect together flow lines of decision shape. FLOWLINE symbol is used to show the direction of the program flow between other symbols. Num 3 cgpa > 2.00 A ITEC113 Lecture Notes 1

Flowcharting Shapes ITEC113 Lecture Notes 1

Pseudocode Pseudocode is structured english that is used as an alternative method to flowcharts for planning structured programs. There are no general accepted standards for pseudocodes. We will work with a form that has minimum number of rules and is essentially language-independent. Pseudo-code instructions are written in English, they can be easily understood and reviewed by users. The only syntax rules to be concerned with involve the LOOP and SELECTION structures. They must be used as CAPITALISED words. ITEC113 Lecture Notes 1

References CPIT/CSIT113 Lecture Notes, Mustafa Tuncel, Akile Yuvka, Yesim Kapsil Yuksel Uckan, Problem Solving Using C,Structured Programming Techniques, McGraw-Hill Deitel and Deitel, C: How to Program, McGraw-Hill ITEC113 Lecture Notes 1