A High-Level Model For Software Development

Slides:



Advertisements
Similar presentations
More on Algorithms and Problem Solving
Advertisements

Flow Charts, Loop Structures
Introduction to Flowcharting
Introduction to Flowcharting
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
Subject: Information Technology Grade: 10
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
 Control structures  Algorithm & flowchart  If statements  While statements.
ITEC113 Algorithms and Programming Techniques
Designing Software With Flowcharts And Pseudo-code
James Tam A High-Level Model For Software Development What is involved in the process of designing, writing and maintaining computer programs?
J. Michael Moore Structured Programming CPSC 110 Drawn from James Tam's material.
J. Michael Moore Structured Programming CSCE 110 Drawn from James Tam's material.
Program Design and Development
Making Decisions In Python
Structured Program Development in C
Chapter 2: Algorithm Discovery and Design
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOWCHARTS
Adapted from slides by Marie desJardins
CSC103: Introduction to Computer and Programming
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 5 Structured Program.
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Invitation to Computer Science, Java Version, Second Edition.
Chapter 2 - Algorithms and Design
UniMAP Sem1-08/09EKT120: Computer Programming1 Week 1 – Lecture 1.
Input, Output, and Processing
CS CS Computing for Business Instructor:David Tucker GTA:Batul Mirza.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
Chapter 2 - Algorithms and Design print Statement input Statement and Variables Assignment Statement if Statement Flowcharts Flow of Control Looping with.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Flowcharts and Algorithms. Review of Terms  A computer is a machine that can represent and manipulate data –Ultimately the data and the instructions.
1 Chapter 2 - Algorithms and Design print Statement input Statement and Variables Assignment Statement if Statement Flowcharts Flow of Control Looping.
PROBLEM SOLVING WITH LOOPS Chapter 7. Concept of Repetition Structure Logic It is a computer task, that is used for Repeating a series of instructions.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 21, 2005 Lecture Number: 10.
Algorithms & Flowchart
ITEC113 Algorithms and Programming Techniques
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
Dale Roberts 1 Program Control - Algorithms Department of Computer and Information Science, School of Science, IUPUI CSCI N305.
Structured Program Development Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010.
`. Lecture Overview Structure Programming Basic Control of Structure Programming Selection Logical Operations Iteration Flowchart.
James Tam Making Decisions In Python In this section of notes you will learn how to have your programs choose between alternative courses of action.
(C)opyright 2000 Scott/Jones Publishers Introduction to Flowcharting.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
 Software Development Life Cycle  Software Development Tools  High Level Programming:  Structures  Algorithms  Iteration  Pseudocode  Order of.
The Hashemite University Computer Engineering Department
UniMAP Sem2-10/11 DKT121: Fundamental of Computer Programming1 Introduction to C – Part 1.
Topics: Selection Statements. Processing Involving Selecting Instructions An instruction that allows deviation and selection to take place uses the ‘IF’
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
CIS 115 AID Peer Educator/cis115aid.com FOR MORE CLASSES VISIT
ALGORITHMS AND FLOWCHARTS
3.1 Fundamentals of algorithms
Algorithms and Flowcharts
Introduction To Flowcharting
CIS115 Education for Service-- snaptutorial.com
CIS 115 Teaching Effectively-- snaptutorial.com
ALGORITHMS AND FLOWCHARTS
Unit# 9: Computer Program Development
How to develop a program?
MSIS 655 Advanced Business Applications Programming
Structured Program
1) C program development 2) Selection structure
ALGORITHMS AND FLOWCHARTS
` Structured Programming & Flowchart
Flowcharts and Pseudo Code
Structural Program Development: If, If-Else
Presentation transcript:

A High-Level Model For Software Development What is involved in the process of designing, writing and maintaining computer programs? What are some ways that an algorithm can be specified?

What Is Computer Science? Review: Solving problems with the computer

A Model For Creating Computer Software Specify the problem Determine how to solve the problem Implement the solution Maintenance of the solution

Specifying The Problem Determine what problem will be solved by the computer Verify the problem

Determine How To Solve The Problem Specify the algorithm Can be done in many ways e.g., flowcharts, spreadsheets (more to come later in this section of notes) Implementation independent! Check the algorithm

Implement The Design Translating the high level algorithm to an actual programming language (e.g., Pascal) Test the program This step is covered in the balance of this course (and the next course, CPSC 233)

Maintaining The Design Modify the program according to changing needs and to address problems (software bugs) Includes the application of techniques for good design (Software Engineering). Some in CPSC 233 (more in CPSC 333)

What You Now Know: A Model For Creating Computer Software Specify the problem Determine how to solve the problem (algorithm) Implement the solution Maintenance of the solution

What Is An Algorithm? The steps needed to solve a problem Characteristics Specific Unambiguous Language independent

Ways Of Specifying The Algorithm Pseudo-code Flowcharts

Pseudo-Code Employs 'programming-like' statements to depict the algorithm No standard format (language independent)

Pseudo-Code Statements Display Enter Action Decision making Repetition Statements are carried out in order Example: Calling up a friend Look up telephone number Punch in telephone number Wait for someone to answer : :

Variables Are used with pseudo-code statements Symbols (typically an alphabetic string e.g,, x, num, num1) used to store values The value stored can change during the algorithm

Constants Are used with pseudo-code statements They are values that cannot be changed

Display Used to show information General format: Example Line of text: Display 'Message' Variable: Display Name of variable Mixed display: Separate each item to be displayed with a comma Example Display 'Available credit limit $', limit

Enter Used to get information Information is stored in a variable General format: Enter: Name of variable Example: Enter userName

Pseudo-Code: Action For computer programs it's usually an assignment statement (sets a variable to some value) General form: Variable = arithmetic expression Example: x = 2 x = x + 1 a = b * c

Pseudo-Code: Decision Making If-then General form: if (condition is met) then statement(s) Example: if temperature < 0 then wear a jacket If-then-else else statements(s)

Pseudo-Code: Decision Making (2) Example: if (at work) then Dress formally else Dress casually

Pseudo-Code: Decision Making (3) Types of conditions Symbol Greater than > Greater than or equal to ≥ Less than < Less than or equal to ≤ Equal to = Not equal to ≠

Pseudo-Code: Repetition repeat-until while-do

Pseudo-Code: Repetition (2) repeat-until Repeat at least once (check if condition is met after statement(s)) General form: repeat statement(s) until (condition is met) Example: Go up to buffet table until full

Pseudo-Code: Repetition (3) while-do Repeat zero or more times (check if condition is met before statement(s)) General form: while (condition is met) do statement(s) Example: while students ask questions do Answer questions

Pseudo-Code: Fast Food Example Use pseudo-code to specify the algorithm for a person who ordering food at a fast food restaurant. At the food counter, the person can either order or not order the following items: a burger, fries and a drink. After placing her order the person then goes to the cashier.

Pseudo-Code: Fast Food Example Approach counter If want burger then Order burger If want fries then Order fries If want drink then Order drink Pay cashier

Pseudo-Code: Grade Tabulator Example Use pseudo-code to specify the algorithm for a grade tabulation program. The program will ask the instructor to enter in a percentage value for each student. Based on this value the program will determine if the student passed the course or not: If the percentage is 50% or greater then the student passed the course and the message 'Student receives course credit' will appear. Otherwise, if the percentage is below 50%, then the student failed the course and the message 'Student will not receive course credit' will appear. As the instructor is entering grades, the program will automatically track the number of students who passed the course and the number of students that did not. The instructor indicates to the program that she has finished entering the grades by entering negative percentage (e.g., -1%) at which time the program displays the total number of students that passed and total that did not pass and it then ends execution.

Pseudo-Code: Grade Tabulator Example pass = 0 fail = 0 Display 'Enter percentage for student (negative percentage to end): ' Enter percentage While Percentage ≥ 0 do If (percentage ≥ 50) then Display 'Student receives course credit' pass = pass + 1 Else Display 'Student will not receive course credit' fail = fail + 1 Display 'Number of students that passed: ', pass Display 'Number of students that failed: ', fail

Summary Of Pseudo-Code Statements Statement Purpose Display Display information Enter Get information Action Perform an activity (not covered by the other statements) Decision Choose between different alternatives Repetition Perform a step multiple times Variables are used in conjunction with these statements to store information. Constants may be used to represent a value that does not ever change.

Basic Flowchart Elements Action Terminator Input Output Off page Connector Decision Terminator – start or end of algorithm Process – an atomic activity Input – get information Output –display information Decision – choose between alternatives Off page connector – use to connect the different parts of a flowchart if it spans multiple pages Arrow – indicates the order of the steps in an algorithm Variables – used to store information c Arrow Variables and constants

Flowchart: Fast Food Example Draw a flowchart to outline the algorithm for a person who ordering food at a fast food restaurant. At the food counter, the person can either order or not order the following items: a burger, fries and a drink. After placing her order the person then goes to the cashier.

Flowchart: Fast Food Example Approach counter Want burger? Order burger Y N Want fries? Order fries Y N Want Drink? Order drink Y N Pay cashier

Flowchart: Grade Tabulator Example Use a flowchart to specify the algorithm for a grade tabulation program. The program will ask the instructor to enter in a percentage value for each student. Based on this value the program will determine if the student passed the course or not: If the percentage is 50% or greater then the student passed the course and the message 'Student receives course credit' will appear. Otherwise, if the percentage is below 50%, then the student failed the course and the message 'Student will not receive course credit' will appear. As the instructor is entering grades, the program will automatically track the number of students who passed the course and the number of students that did not. The instructor indicates to the program that she has finished entering the grades by entering negative percentage (e.g., -1%) at which time the program displays the total number of students that passed and total that did not pass and it then ends execution.

Flowchart: Grade Tabulator Example Begin pass = 0 fail = 0 'Enter percentage for student (negative to end'): ' Percentage 1

Flowchart: Grade Tabulator Example (2) 1 6 Percentage ≥ 0? N 2 Y Percentage ≥ 50? N 3 Y 4

Flowchart: Grade Tabulator Example (3) 'Student will not receive course credit' fail = fail + 1 5

Flowchart: Grade Tabulator Example (4) 'Student receives course credit' pass = pass + 1 5

Flowchart: Grade Tabulator Example (5) 'Enter percentage for student (negative to end'): ' Percentage 6

Flowchart: Grade Tabulator Example (6) 2 'Number of students that failed: ', fail 'Number of students that passed: ', pass End

Summary What are the major steps involved in creating software Specification Design Implementation Maintenance How to layout out an algorithm using flowcharts and pseudo- code What are the basic elements of algorithms Input Output Decision-Making Repetition Action Variables and constants