BPC.1 Basic Programming Concepts

Slides:



Advertisements
Similar presentations
PROBLEM SOLVING TECHNIQUES
Advertisements

CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Programming Types of Testing.
Programming Techniques1 POWER OF LOGIC Programming Techniques “CHI BEN COMINCIA E’ A META’ DELL’OPERA” Cutajar and Cutajar.
Program Development Procedures 1.Program definition clearly define what the problem is. clearly define Input and output data (types, precision, units used)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
Chapter 3 Planning Your Solution
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
ALGORITHMS AND FLOWCHARTS
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 02.
Introduction 01_intro.ppt
Structured COBOL Programming, Stern & Stern, 9th edition
1 Shawlands Academy Higher Computing Software Development Unit.
CHAPTER:14 Programming Methodology Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
หลักการโปรแกรม เพื่อแก้ปัญหาโดยใช้คอมพิวเตอร์
Programming Lifecycle
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Programming Concepts Chapter 3.
Chapter 1 Introduction to Structured Design. Introduction  System  A combination of people, equipment, and procedures that work together to perform.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
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.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
I Power Higher Computing Software Development The Software Development Process.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
1 Programming with MATLAB ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
The Software Development Process
1 Program Planning and Design Important stages before actual program is written.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
PROGRAMMING GUIDELINES. SYLISTIC GUIDELINES  Meaningful names for identifiers Identifiers identify different parts of C++ programs. Identifiers should.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
The Hashemite University Computer Engineering Department
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Programming Languages
Lecture 1 Introduction Richard Gesick.
Key Ideas from day 1 slides
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
An Introduction to Visual Basic .NET and Program Design
ALGORITHMS AND FLOWCHARTS
Unit# 9: Computer Program Development
Problem Solving Techniques
PROGRAMMING METHODOLOGY
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
ALGORITHMS AND FLOWCHARTS
Chapter 1 Introduction(1.1)
The Programming Process
Programming Fundamentals (750113) Ch1. Problem Solving
Software Development Process
ICT Gaming Lesson 2.
Programming Fundamentals (750113) Ch1. Problem Solving
CHAPTER 6 Testing and Debugging.
Presentation transcript:

BPC.1 Basic Programming Concepts 1.1 Program development procedures 1.2 Problem analysis techniques 1.3 Algorithm design 1.4 Program debugging 1.5 Program documentation 1.6 Problem solving approaches 1.7 Structured programming 1.8 Good programming style

Program development procedures

Program development procedures

Problem Analysis Concept of modularity Stepwise refinement Divide the statements into logical groups called module. Each module performs one or two tasks. The modules are usually written in the form of sub-programs. Stepwise refinement Break down a problem into smaller parts (or modules) until it becomes manageable.

Designing an algorithm a set of ordered steps Pseudocode is used to shorten the statement There is NO syntax in writing algorithm Pseudocode may include basic programming: 1. Using assignment statement e.g. A5, A = 5 or A := 5 means putting 5 into variable A 2. Using conditional statements, like If...then...else...end if, represent different actions some conditions. 3. Using indentation to clarify the statements blocks.

Using program flowchart to realise algorithm Graphical representation of instructions Representing the logic of a single program Can be converted into programming constructs: branching iteration structures

E.g. 1 Example 1 Assign different value to Y depending on the input value.

E.g. 2 Example 2 Calculate the sum of 1 + 2 + ... + 10. Output is 55

Debugging and Testing Debugging Testing Finding out errors (bugs錯誤[蟲]) and Removing them Compare the output with the expected one Testing Verify that the program will process all data properly Should use both valid and invalid test data

Programming Errors 1. Syntax (語法) Errors 2. Run-time (執行) Errors Violation of the grammatical rule of a programming language e.g. Wrong spelling of some keywords 2. Run-time (執行) Errors Cause a program to terminate abnormally e.g. Division-by-zero error, Out of memory error. 3. Logical (邏輯) Errors Caused by an incorrect algorithm Producing an unexpected result, e.g. an average mark > 100 May not be discovered until it is too late So, programs should be well tested before use

Documentation Documentation User manual Written description about the solution to a problem User manual Instruct user how to operate the program effectively Including: 1. Procedures in starting the program 2. Description of buttons/commands in the menu 3. Description of error messages and how to handle such errors 4. Description of defaults values 5. Sample procedures in finishing a task

Documentation Technical documentation for programmers or technical people providing information about how the solution is developed Useful for maintenance and further development Including: 1. Description of the problem 2. Algorithm 3. Program flowchart 4. Program listing with comments 5. List of files used 6. Test data 7. Sample output

Different Ways to Solve a Problem A. Packaged software vs Custom software Packaged software Pre-written software available for purchase Less expensive Company may need to adjust in order to use packaged software Custom software Written by IT department Match the company’s requirements But, more expensive and take a longer time to develop

Different Ways to Solve a Problem B. Planning vs Without Planning Usually more than one logical solution An easy one may solve the problem temporarily But, when new problem arises, programs may be difficult to change Programs should have careful planning before development Otherwise, take much longer and more effort to change

Structured programming Sequence Steps follow each other in a logical sequence. Alternation They may be if or case statements. Iteration They are while, for or repeat statements.

Good programming style Structured program Modular design Readable Reusable Reliable Portable Program documentation