Developing a Program.

Slides:



Advertisements
Similar presentations
CS 240 Computer Programming 1
Advertisements

Chapter 3 Program Design And Branching Structures.
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Subject: Information Technology Grade: 10
INTRODUCTION TO PROGRAMMING
Programming recap. Do you know these? LOW LEVEL 1 st generation: machine language (110011) 2 nd generation: assembly language (ADD, SUB) HIGH LEVEL 3.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Chapter 3 Planning Your Solution
The Program Design Phases
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Chapter 02 (Part III) Introduction to C++ Programming.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Introduction to Programming with RAPTOR
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Visual Basic Programming
`. Lecture Overview Structure Programming Basic Control of Structure Programming Selection Logical Operations Iteration Flowchart.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Introduction to Computing Dr. Nadeem A Khan. Lecture 2.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
 Problem Analysis  Coding  Debugging  Testing.
Algorithms and Flowcharts
Chapter 1.2 Introduction to C++ Programming
ALGORITHMS AND FLOWCHARTS
Chapter 1.2 Introduction to C++ Programming
Topics Designing a Program Input, Processing, and Output
Introduction to Flowcharting
Lesson 2 Flowcharting.
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
Chapter 2: Input, Processing, and Output
Chapter 2- Visual Basic Schneider
Introduction to Computing
Algorithms and Flowcharts
The Selection Structure
Understand Problem Solving Tools to Design Programming Solutions
Teaching design techniques to design efficient solutions to problems
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Lecture 2 Introduction to Programming
Introduction To Flowcharting
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Programming Logic n Techniques
Microsoft Visual Basic 2005 BASICS
Print slides for students reference
Designing and Debugging Batch and Interactive COBOL Programs
Unit# 9: Computer Program Development
Introduction to C++ Programming
PROBLEM SOLVING CSC 111.
Chapter 2- Visual Basic Schneider
Design and Implementation
Introduction to Algorithms and Programming
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
` Structured Programming & Flowchart
Faculty of Computer Science & Information System
Chapter 2- Visual Basic Schneider
Chapter 5: Control Structure
Understanding Problems and how to Solve them by using Computers
Software Development Process
No Yes START Do you live in Scotland? Take umbrella See last Flowchart
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Chapter 3: Selection Structures: Making Decisions
Flowcharts and Pseudo Code
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Chapter 2: Input, Processing, and Output
Basic Concepts of Algorithm
Introduction to Programming
Presentation transcript:

Developing a Program

Writing a program Defining the problem Planning Programming Write down what the program will do Planning Write down the steps, draw a flowchart Programming Coding, including errors correction, testing Documenting Adding comments Implementing Improvement, making the program better

Objective A program can be divided into 3 parts: Input data Processing data – Calculation, etc. Output information/results Calculation/ Processing Input Output

A Diagram that uses special symbols showing the steps of a program Planning - Flowchart A Diagram that uses special symbols showing the steps of a program

What is a flowchart? A diagram made up of symbols of various shapes connected by arrows. Those symbols indicate either actions to be taken or decisions to be made. It may be used to describe any complicated process when a mixture of actions & decisions take place It helps us planning & programming.

Flowchart Symbols T F Decision symbol (Selection, Conditional Statement) Terminal symbol (Start & Stop) Page connector (used when run out of room at the bottom) 2 Processing symbol (Calculate, Assign, Initialize, Declare) 1 Step connector (go from one part to another) A Input/Output symbol (get, put) A

Terminal Symbol start stop Only one “start” & one “stop” 1 arrow only Each flowchart starts with one “start” & ends with one “stop” start stop

Input / Output Symbol 2 arrows only Input Data Display result 1 in & 1 out Input Data get fullname:* Display result put fullname

Processing Symbol 2 arrows only Declaration Initialization Calculation 1 in & 1 out Declaration var sum : real Initialization sum := 30.14 Calculation

Decision Symbol T Q. ? F 3 arrows Question 2 out going arrows 1 in & 2 out Question worded this way that the answer is Yes or No 2 out going arrows T (True, Yes) F (False, No) Q. ? T F

Loop and Block For/while/do와 같은 반복문 여러 개의 명령어로 구성된 Block

Page connector 2 1 1 arrow only Shows the next page Shows the previous page Run out of space

Step connector A A 1 arrow only Appear in Use letters Many to 1 Use letters Go from one step to another A A

Arrows From Top to Bottom & from Left to Right Make turn Join together

Example start 1.is it the door bell? 2.start 3.answer the phone 4.turn off the alarm 5.is it the telephone? 6.listen to bell ringing 7.stop 8.see who is at the door bell ringing N N turn off the alarm phone? door? Y Y answer the phone see who is at the door stop

Example const PI := 3.14 var radius, volume : real start Define PI const PI := 3.14 var radius, volume : real put “please enter...”.. get radius volume := (4/3)*PI*radius**3 put “” put “The volume is”, volume Declare radius, volume ask radius input radius Calculate volume output volume stop

Example start 1.start declare variables 2.what is the mark var mark: real _____ mark mark stop A T F ask mark 1.start declare variables 2.what is the mark 3.ask for mark 4.check mark>=50 5.>=50 show “U Pass” 6.<50 show “U Fail” 7.stop get “U Pass” >=50 “U Fail”

Example with Trace Table start x y sum Declare & Initialise x & y to1 1 1 2 1 2 3 A is sum<20 sum of x&y Y x = y y = sum 2 3 5 3 5 8 N A Show x,y and sum 5 8 13 8 13 21 stop

Programming Convert the steps to instructions / programming languages Debug – correct the errors Syntax errors Grammar mistakes which are easily found out Logical errors Programs run & work but the outcome is not correct / expected Can be found by testing

Documentation Add comments Use spaces wisely Easier to understand Use spaces wisely Blanks, Tabs, New Lines Easy to trace, follow & understand Choose variables & constants names Easy to understand, not too long or short

Implementation Ask others to run your program Make it more user friendly including input & output Make it more efficient (fewer lines) Make it run faster Add ending screen etc.