PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.

Slides:



Advertisements
Similar presentations
Chapter 1 An Overview of Computers and Programming Languages.
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.
Computers Are Your Future
Introduction to Programming, Algorithms & Flow Charts
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
Computers: Tools for an Information Age
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:
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
PRE-PROGRAMMING PHASE
CS102 Introduction to Computer Programming
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
計算機程式語言 Lecture 01-1 國立臺灣大學生物機電系 1 1 Preliminaries.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
CHAPTER 1 Overview of Programming and Problem Solving.
Chapter 1: Preliminaries. Objectives In this chapter, you will learn about: Unit analysis Exponential and scientific notations Software development Algorithms.
INTRODUCTION TO PROGRAMMING, ALGORITHMS & FLOWCHARTS Programming in C2 CHAPTER 1.
Programming Lifecycle
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
A First Book of ANSI C Fourth Edition
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
Lesson 5 Essence of Programming 2007/09/28. 2 index Reviewing computer hardware Introduction of programming language Algorithms Structured programming.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
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.
Programming Fundamentals1 Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Computer Programming CONTENTS Introduction to Operating Systems Introduction to programming languages Introduction to perl programming language Programming.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
The Hashemite University Computer Engineering Department
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Chapter 1 An Overview of Computers and Programming Languages.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
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.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 0: Historical Overview.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Computer Programming (BCT 1113)
CSCI-235 Micro-Computer Applications
Lecture 2 Introduction to Programming
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 Introduction(1.1)
The Programming Process
Introduction to Computer Programming
Chapter 1: Preliminaries
Presentation transcript:

PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation Testing and Debugging. Typical C++ Development Environment Variable Data Types Identifiers

2 Objectives In this chapter the topic will be cover: Introduction to Programming Computer programming concepts Problem solving Flowchart Structured programming design Implementation Documentation Testing and debugging

3 Introduction to Programming Program: self-contained set of instructions used to operate a computer to produce a specific result –Also called software Programming: the process of writing a program, or software

4 Introduction to Programming: Machine Language Machine language programs, also called executables, consist of binary instructions Each instruction has two parts: –Instruction part: the operation to be performed; also called an opcode –Address part: memory address of the data to be used Each class of computer has its own particular machine language Writing in machine language is tedious!

5 Introduction to Programming: Assembly languages Assembly Language: programming language with symbolic names for opcodes, and decimals or labels for memory addresses Example: ADD 1, 2 MUL 2, 3 Assembly language programs must be translated into machine instructions, using an assembler

6 Introduction to Programming: Assembly languages

7 Introduction to Programming: Low- and High-Level Languages Low-level languages: languages that use instructions tied directly to one type of computer Examples: machine language, assembly language High-level languages: instructions resemble written languages, such as English,and can be run on a variety of computer types Examples: Visual Basic, C, C++, Java

8 Introduction to Programming: Low- and High- Level Languages (continued) Source code: the programs written in a high- or low-level language Source code must be translated to machine instructions in one of two ways: –Interpreter: each statement is translated individually and executed immediately after translation –Compiler: all statements are translated and stored as an executable program, or object program; execution occurs later

9 Introduction to Programming: Low- and High- Level Languages (continued) Large C++ programs may be stored in two or more separate program files due to –Use of previously written code –Use of code provided by the compiler –Modular design of the program (for reusability of components) Linker: combines all of the compiled code required for the program

10 Introduction to Programming: Procedural and Object Orientations Programs can also be classified by their orientation: –Procedural: available instructions are used to create self-contained units called procedures –Object-oriented: reusable objects, containing code and data, are manipulated Object-oriented languages support reusing existing code more easily

11 Introduction to Programming: Procedural and Object Orientations (continued) Figure 1.1: Creating an executable C++ program.

12 Introduction to Programming: Application and System Software Application software: programs written to perform particular tasks for users System software: collection of programs to operate the computer system –System software must be loaded first; called booting the system –Bootstrap loader: a permanent, automatically executed component to start the boot process

13 Introduction to Programming: Application and System Software (continued) Operating system: the set of system programs used to operate and control a computer; also called OS Tasks performed by the OS include –Memory management –Allocation of CPU time –Control of input and output –Management of secondary storage devices

14 Introduction to Programming: Application and System Software (continued) Multi-user system: a system that allows more than one user to run programs on the computer simultaneously Multitasking system: a system that allows each user to run multiple programs simultaneously; also called multiprogrammed system

15 Introduction to Programming: The Development of C++ The purpose of most application programs is to process data to produce specific results Basic procedural operations.

16 Introduction to Programming: The Development of C++ (continued) Early procedural languages included –FORTRAN: Formula Translation –ALGOL: Algorithmic Language –COBOL: Common Business Oriented Language –BASIC: Beginners All-purpose Symbolic Instruction Code –Pascal –C Early object-oriented language: –C++

17 Problem Solving and Software Development Software development procedure: method for solving problems and creating software solutions –Consists of three phases: Phase I: Development and Design Phase II: Documentation Phase III: Maintenance Software engineering: discipline concerned with creating efficient, reliable, maintainable software

18 Problem Solving and Software Development (continued) The three phases of software development.

19 Problem Solution and Software Development: Phase I. Development and Design Program requirement: request for a program or a statement of a problem After a program requirement is received, Phase I begins Phase I consists of four steps: –Analysis –Design –Coding –Testing

20 Problem Solution and Software Development: Phase I (continued) The development and design steps.

21 Problem Solution and Software Development: Phase I (continued) Step 1: Analyze the Problem –Analyst must understand What outputs are required What inputs will be needed How the inputs can be used to produce the desired outputs –Failure to analyze and understand the requirements leads to a failed solution!

22 Problem Solution and Software Development: Phase I (continued) Step 2: Develop a Solution –Algorithm: the exact steps used to solve a problem –Algorithm is usually defined at high level, then refined to detailed lower levels –Structure level diagrams may be used to represent the levels of analysis Continue..

23 Problem Solution and Software Development: Phase I (continued) First-level structure diagram.

24 Problem Solution and Software Development: Phase I (continued) Second-level refinement structure diagram.

25 Problem Solution and Software Development: Phase I - Algorithm (continued) Example: Calculate the sum of all whole numbers from 1 through 100

26 Problem Solution and Software Development: Phase I - Algorithm (continued)

27 Problem Solution and Software Development: Phase I - Algorithm (continued)

28 Problem Solution and Software Development: Phase I - Flowchart

29 Problem Solution and Software Development: Phase I - Flowchart (continued) Continue..

30 Flowchart for calculating the average of three numbers. Problem Solution and Software Development: Phase I - Flowchart (continued) Continue..

31 Problem Solution and Software Development: Phase I (continued) Step 3: Structured Programming Design –Also called writing the program, and implementing the solution –Program should contain well-defined patterns or structures of the following types: Sequence Selection Iteration Invocation

32 Problem Solution and Software Development: Phase I (continued) Sequence: defines the order in which instructions are executed Selection: allows a choice between different operations, based on some condition Iteration: allows the same operation to be repeated based on some condition; also called looping or repetition Invocation: involves invoking a set of statements when needed

33 Problem Solution and Software Development: Phase I (continued) Step 4: Test and Correct the Program –Testing: method to verify correctness and that requirements are met –Bug: a program error –Debugging: the process of locating an error, and correcting and verifying the correction –Testing may reveal errors, but does not guarantee the absence of errors

34 Problem Solution and Software Development: Phase I (continued) Testing requires the use of meaningful, representative test data Impossible to test all possible combinations of data and operations in a complex program Testing plans must be developed to ensure good coverage in testing Testing usually requires more time than other steps in Phase I

35 Problem Solution and Software Development: Phase II. Documentation Many documents may be required, including –Program description –Algorithm development and changes –Well-commented program listing –Sample test runs –Users’ manual

36 Problem Solution and Software Development: Phase III. Maintenance Maintenance includes –Ongoing correction of newly discovered bugs –Revisions to meet changing user needs –Addition of new features Maintenance usually the longest phase, and may be the primary source of revenue Good documentation vital for effective maintenance

37 Problem Solution and Software Development: Backup Backup: process of making copies of program code and documentation on a regular basis Backup copies = insurance against loss or damage –Consider using off-site storage for additional protection

38 Common Programming Errors Common errors include –Starting to write the program before fully understanding the requirements and the algorithm to be used –Failing to make backups periodically –Failing to provide complete, precise instructions in the programming language

39 Summary Software: programs used to operate a computer Programming language types: –Low-level languages Machine language (executable) programs Assembly languages –High-level languages Compiler and interpreter languages

40 Summary (continued) Software engineering: discipline concerned with creating readable, efficient, reliable, and maintainable programs Three phases in software development: –Program development and design –Documentation –Maintenance

41 Summary (continued) Four steps in program development and design: –Analyze the problem –Develop a solution –Code the solution –Test and correct the solution Algorithm: step-by-step procedure that describes how a task is performed Computer program: self-contained unit of instructions and data used to operate a computer to produce a desired result

42 Summary (continued) Four fundamental control structures used in coding: –Sequence –Selection –Iteration –Invocation

Exercise 1. Analyse the problem base on the structure chat at figure Write a pseudocode for figure 1.6 diagram. 3. Base on the pseudocode draw a flow chart. 43