Introduction to Computing Dr. Nadeem A Khan. Lecture 2.

Slides:



Advertisements
Similar presentations
CS 240 Computer Programming 1
Advertisements

Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
1.4 Programming Tools Flowcharts Pseudocode Hierarchy Chart
Introduction to Flowcharting
PSEUDOCODE & FLOW CHART
Flow Control Analysis & Design Tool: Flowcharts
Chapter 1 - An Introduction to Computers and Problem Solving
Introduction to Programming
Chapter 2 - Problem Solving
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
CS 240 Computer Programming 1
Fundamentals of Algorithms MCS - 2 Lecture # 4
ITEC113 Algorithms and Programming Techniques
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider
Programming Tools Flowcharts Pseudocode Algorithm Chapter 2.
Introduction to Computing Dr. Nadeem A Khan. Lecture 4.
Introduction to Computing Dr. Nadeem A Khan. Lecture 4.
The Program Development Cycle and Program Design Tools
Developing logic (Examples on algorithm and flowchart)
Introduction to Computing Dr. Nadeem A Khan. Lecture 5.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
The Program Design Phases
Review Algorithm Analysis Problem Solving Space Complexity
Algorithm & Flowchart.
Introduction to Computers and Programming
CSC103: Introduction to Computer and Programming
DCT 1123 Problem Solving & Algorithms
1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development.
IE 212: Computational Methods for Industrial Engineering
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
Chapter 2 - VB.NET by Schneider1 Chapter 2 - Problem Solving Program Development Cycle Programming Tools.
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.
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
Chapter 2: General Problem Solving Concepts
Program Planning and Design. What is Program Planning and Design? Program planning and design is simply knowing what you want to do and how you want to.
Chapter 11 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development.
1 Program Planning and Design Important stages before actual program is written.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Expressing Algorithms as Flowcharts and Pseudocode
FLOWCHARTING AND ALGORITHMS
Fundamentals of Algorithms MCS - 2 Lecture # 3. Representation of Algorithms.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Program Design & Development EE 201 C7-1 Spring
 Problem Analysis  Coding  Debugging  Testing.
Program Development Cycle
Chapter 2- Visual Basic Schneider
Introduction to Computing
Introduction To Flowcharting
Numbering System TODAY AND TOMORROW 11th Edition
Structured Program
Chapter 2- Visual Basic Schneider
Introduction to Algorithms and Programming
Chapter 1 - An Introduction to Computers and Problem Solving
Faculty of Computer Science & Information System
Chapter 2- Visual Basic Schneider
Flowcharts and Pseudocode
Presentation transcript:

Introduction to Computing Dr. Nadeem A Khan

Lecture 2

Read Chapter 3

Program Planning 1. Analyze 2. Design 3. Choose the Interface 4. Code 5. Test and Debug 6. Complete the Documentation

The Problem-Solving Process Input Processing Output

Program Design Tools ► Pseudo-code ► Flow Charts ► Hierarchy Charts

Postage stamp problem: How many stamps to put on a envelop given one stamp is needed for every five sheets of paper or a fraction thereof How many stamps to put on a envelop given one stamp is needed for every five sheets of paper or a fraction thereof

Pseudocode ► Abbreviated version of actual computer code in English-like statements

Pseudo code: Postage Stamp Problem ► Program – Determine the number of stamps for a letter Read Sheets Set the number of stamps to sheets / 5 Round the number of stamps Display the number of stamps

Flowcharts ► Special geometric symbols connected by arrows

Postage stamp problem Start Read sheets Set stamps = sheets/ 5 Display stamps Round stamps up to next whole number End input processing output processing

Elements of Flowcharts Symbol Name Flowline Terminal Input/Output Processing Decision

Continued… Symbol Name Connector Off page Connector Predefined process Annotation

Hierarchy chart ► Shows overall program structure

Hierarchy Charts: Postage Stamp Problem Postage Stamp Problem Read Sheets Calculate stamps Display stamps Set stamps = sheets/5 Round stamps to next whole number

Another problem: Given a street number of one-way street in New York, decide the direction of the street, either eastbound or westbound Given a street number of one-way street in New York, decide the direction of the street, either eastbound or westboundNote: Even numbered street: Eastbound Odd numbered street: Westbound

Decisions ► Sequence Structure – a sequence followed without skipping any line. ► Decision Structure – a structure which requires a decision for any lines of code to be executed.

Decision Structure: Pseudocode IF condition is TRUE THEN Process step(s) 1 ELSE Process step(s) 2 Process step(s) 2 END IF

Decision Structure: Flowchart Process Step (s) 2 Is Condition True Process Step (s) 1

Decision Structure: Pseudocode What in case of multiple conditions?

Decision Structure: Pseudocode IF condition 1 is TRUE THEN Process step(s) 1 ELSE IF condition 2 is TRUE THEN Process step(s) 2 Process step(s) 2ELSE Process step(s) 3 END IF

Pseudo-Code: Street Direction Problem Get Street IF Street is EVEN Display Eastbound ELSE Display Westbound END IF

Flow Chart: Street Direction Problem End Start Get Street Is street even? Display Westbound Display Eastbound

Hierarchy Chart: Street Direction Problem Street Direction Program Get Street Number Decide whether street number is odd or even Display direction

Still Another Problem ► Calculate and report the grade-point average of a class.

The Loop Structure ► A programming structure that executes instructions many times.

Flow chart: loop structure No Process Step(s) Is condition true ? Yes

Pseudo code: loop structure ► DO WHILE condition is TRUE Process Step(s) LOOP

Draw the Flowchart for the class average problem

Pseudo code: Class Average Problem INITIALIZE Counter and Sum to 0 DO WHILE there are more data Get the next Grade Add the Grade to the Sum Increment the Counter LOOP Compute Average = Sum/Counter Display Average

Hierarchy Chart: Class Average Problem Class average program Get grade Compute sum Display average Calculate average