Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Lecture 1: Overview of Computers & Programming
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Programming Types of Testing.
Chapter 1 - An Introduction to Computers and Problem Solving
16/13/2015 3:30 AM6/13/2015 3:30 AM6/13/2015 3:30 AMIntroduction to Software Development What is a computer? A computer system contains: Central Processing.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
Course: Introduction to Computers
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
ITEC113 Algorithms and Programming Techniques Introduction to Programming.
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Introduction to Computer Programming
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
ITEC113 Algorithms and Programming Techniques
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
CSC141 Introduction to Computer Programming
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
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.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
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.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 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.
Chapter One An Introduction to Programming and Visual Basic.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
1 Overview of Programming Principles of Computers.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
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.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
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.
Evolution and History of Programming Languages
Chapter 1 Introduction 2nd Semester H
Introduction to Computers and C++ Programming
Programming Languages
Introduction to programming
CSCI-235 Micro-Computer Applications
Lecture 1: Introduction to JAVA
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 2 Introduction to Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter One: An Introduction to Programming and Visual Basic
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Presentation transcript:

Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu

Computer Programming Computers do what we tell them to do, NOT what we want them to do Computer Programming involves writing instructions and giving them to the computer to complete a task.

What is a Computer Program? A computer program is a set of instructions written in a computer language, in order to be executed to perform a specific task. There are tens of programming languages, used nowadays. Computer Programs are also named as SOFTWARE.

What is a Computer Program? There are different types of software available. Some of them are:  Operating System Software (Win 9x, 2000, Unix, Linux, …).  Compilers and Interpreters (Used with Programming Lang.).  Application Software (Payroll system, Accounting System).  Embedded System Software (Used in TV sets, telephones).  Utilities and Tools for productivity (MS Word, Excel, …).

Who is a Programmer? A programmer is a person who writes the required computer programs. Programmers translate the expected tasks given in human understandable form into machine understandable form by using compilers and interpreters.

Compiler & Interpreter Compiler is a specific software that gets the whole Source Code (Computer program written in human understandable form) and translates it into Object Code (Computer Program that is in machine understandable form) all at a time. Interpreter is translating and executing one statement (command of Computer Program) of Source Code into Object Code at a time. (It means, interpreters translate and execute computer programs line by line).

Execution of a Program. Using Compiler: Source Code Compiler Object Code Execute a line of Program Execute a line of Program Using Interpreter: Source Code Interpreter Execute Program

Well Designed Programs. Well designed programs must be:  Correct and accurate  Easy to understand  Easy to maintain and update  Efficient  Reliable  flexible

Programming Process 1. Problem definition  What must the program do?  What outputs are required and in what form?  What inputs are available and in what form? Example: Find a maximum of two numbers  Input two numbers, compare them and print the maximum value  Inputs and outputs are decimal numbers  Inputs are entered from the keyboard  Result is shown on the monitor

Programming Process 2. Program Design involves creating an algorithm – sequence of steps, by which a computer can produce the required outputs from the available inputs Top-down design  The main problem is split into subtasks  Then each subtask is divided into simpler subtasks, etc. unless it is clear how to solve all such subtasks

Programming Process 3. Program Coding means expressing the algorithm developed for solving a problem, in a programming language Example of source code is on the right #include int main() { int number1, number2; int maximum; printf("Please, enter two numbers: "); scanf("%d %d", &number1, &number2); if (number1 >= number2) maximum = number1; else maximum = number2; printf(“%d is maximum\n“, maximum); return 0; }

Programming Process Program Compilation – translation of a program written in a high-level programming language into machine language instructions Compilation step converts a source program into an intermediate form, called object code Linking step is necessary to combine this object code with other code to produce an executable program The advantage of this two-step approach:  Source of the large program may be split into more than one file  These files are worked on and compiled separately  Object code may be stored in libraries and used for many programs  Then they will be combined into one executable code

Programming Process 4. Program Testing & Debugging  Initially, almost all programs may contain a few errors, or bugs  Testing is necessary to find out if the program produces a correct result. Usually it is performed with sample data  Debugging is the process of locating and removing errors

Types of Errors. Syntax Errors: Violation of syntactic rules in a Programming Language generates syntax errors.  Effect? Interpreter or Compiler finds it in Syntax Check Phase. Semantic Errors: Doing logical mistakes causes semantic errors in Source code.  Effect? Interpreters and Compilers can not notice them, but on execution, they causes unexpected results. Run-time Errors: Occur on program execution. Mostly caused by invalid data entry or tries to use not existing resources.  Effect? It occurs on run time and may crash the program execution

Successful Programming For successful programming give no ambiguity in program instructions give no possibility of alternative interpretations make sure there is only one course of action

Programming Programming task can be made easier  by breaking large and complex programs into smaller and less complex subprograms (modules) Programming task can be separated into 2 phases (see Fig. 1) 1. problem solving phase  produce an ordered sequence of steps that describe solution of problem  this sequence of steps is called an algorithm 2. implementation phase  implement the program in some programming language (Pascal, Basic, C)

Programming Difficult way

What is structured programming  a programming technique that splits the program into smaller segments (modules) to  decrease program development time  decrease program maintenance cost  improve the quality of software  structured programming achieves these goals by using  top-down design and use of modules  use of limited control structures (sequence, selection and repetition)  management control

Types of Programming Languages.  Low-level languages (Machine Lang., Assembly Lang.). Machine language is made up of binary 1s and 0s this is the only programming language the computers can understand advantages of machine languages are: fast execution speed and efficient use of main memory disadvantages of machine languages are writing machine language is tedious, difficult and time consuming 

Types of Programming Languages Assembly language is a low-level interface to CPU functions Example: Movax, 1 Movbx, 2 Add bx

Types of Programming Languages. Assembly Language Writing programs can be very time-consuming, as you have to directly manipulate CPU registers and use complicated interfaces to I/O devices Code is assembled to make Machine Language (consisting only of 1’s and 0’s) which is the real language of the CPU

Types of Programming Languages. » High Level Languages. Slower, needs more resources but more user friendly (needs less programming time and it is more easier to develop a program). Major high-level languages are  FORTRAN, COBOL, PL/I, BASIC, PASCAL, C, LISP, Prolog, Logo