CPS120 Introduction to Computer Programming The Programming Process.

Slides:



Advertisements
Similar presentations
Chapter 1 - An Introduction to Computers and Problem Solving
Advertisements

Lesson 5 - Decision Structure By: Dan Lunney
Introduction to Programming
Chapter 2 - Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
CS0004: Introduction to Programming Repetition – Do Loops.
Chapter 2- Visual Basic Schneider
6-1 Problem Solving Problem solving is the act of finding a solution to a perplexing, distressing, vexing, or unsettled question.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
The Program Design Phases
Adding Automated Functionality to Office Applications.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
Program Development Life Cycle (PDLC)
CPS120: Introduction to Computer Science Decision Making in Programs.
Programming Concepts Chapter 3.
Chapter 3 Developing an algorithm. Objectives To introduce methods of analysing a problem and developing a solution To develop simple algorithms using.
CPS120 Introduction to Computer Science Iteration (Looping)
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
CPS120: Introduction to Computer Science Decision Making in Programs.
Definition of Terms Software/Programs Programs that directs the operation of a computer system Set of instructions Codes Programming Process of planning,
1 CSCI N201 Programming Concepts and Database 9 – Loops Lingma Acheson Department of Computer and Information Science, IUPUI.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
Introduction to Loops For Loops. Motivation for Using Loops So far, everything we’ve done in MATLAB, you could probably do by hand: Mathematical operations.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
CPS120 Introduction to Computer Science Iteration (Looping)
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Prof. Ken Regis Institute for Computer Engineering Florida State University Oktober 2002Prof. Ken Regis - FIT 1-11.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
CPS120: Introduction to Computer Science Decision Making in Programs.
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CPS120: Introduction to Computer Science Decision Making in Programs.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
Fourth Quarter.  Involves loops or cycles ◦ Loops: means that a process may be repeated as long as certain condition remains true or remains false. ◦
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
CPS120: Introduction to Computer Science Session 5.
Fundamentals of Algorithms MCS - 2 Lecture # 3. Representation of Algorithms.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
ICS 3UI - Introduction to Computer Science
Chapter 2- Visual Basic Schneider
Algorithm and Ambiguity
Unit# 9: Computer Program Development
Introduction to Computer Programming
CPS120: Introduction to Computer Science
Problem Solving and Algorithm Design
Chapter 2- Visual Basic Schneider
Coding Concepts (Basics)
Chapter 2- Visual Basic Schneider
Algorithm and Ambiguity
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
ICT Gaming Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Little Man Computer (continued).
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
CPS120: Introduction to Computer Science
Presentation transcript:

CPS120 Introduction to Computer Programming The Programming Process

Analyze the problem Design the solution algorithm Design the user interface Write the code Test and debug the program Complete the documentation The Program Development Cycle

Programs A program is a set of step- by-step instructions that directs the computer to do the tasks you want it to do and produce the results you want.

Programming Languages A programming language is a set of rules that provides a way of telling a computer what operations to perform.

What Can a Program Do? A program can only instruct a computer to: –Read Input –Sequence –Calculate –Store data –Compare and branch –Iterate or Loop –Write Output

Sequence Control Structures Sequence control structures direct the order of program instructions. The fact that one instruction follows another—in sequence—establishes the control and order of operations.

Calculate A program can instruct a computer to perform mathematical operations. Add 1 to Counter

Store A program will often instruct a computer to store intermediate results. Place 1 in Counter

Compare and Branch A program can instruct a computer to compare two items and do something based on a match or mismatch which, in turn, redirect the sequence of programming instructions. –There are two forms: IF-THEN IF-THEN-ELSE

IF-THEN Test condition p falsetrue Entry Exit True statement a

IF-THEN-ELSE falsetrue Entry Exit Test condition p “true” statement a “false” statement a

Iterate A program loop is a form of iteration. A computer can be instructed to repeat instructions under certain conditions. No

Iteration Control Structures Iteration control structures are looping mechanisms. Loops repeat an activity until stopped. The location of the stopping mechanism determines how the loop will work: –Leading decisions –Trailing decisions

Leading Decisions If the stop is at the beginning of the iteration, then the control is called a leading decision. The command DO WHILE performs the iteration and places the stop at the beginning.

DO WHILE Loop No Yes Entry Exit Test condition p Loop statement a

Trailing Decisions If the stop is at the end of the iteration, the control mechanism is called a trailing decision. The command DO UNTIL performs the iteration and puts the stop at the end of the loop.

DO UNTIL Loop Loop statement a NoYes Entry Test condition p Exit

Analyze the problem Design the solution algorithm Design the user interface Write the code Test and debug the program Complete the documentation The Program Development Cycle

Testing the Algorithm The process itself must be tested Testing at the algorithm development phase involves looking at each level of the top- down design

Testing the Algorithm Desk checking: sit at a desk with a pencil and paper and work through the design Walk-through: Manual simulation of the design by the team members –Take sample data values and simulate the design using the sample data Inspection: The design is handed out in advance, and one person (not the designer) reads the design line by line while the others point out errors