Chapter 3 Program Design

Slides:



Advertisements
Similar presentations
Chapter 3: Modules, Hierarchy Charts, and Documentation
Advertisements

Programming Logic and Design Fourth Edition, Introductory
ITEC113 Algorithms and Programming Techniques
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
CS 1400 Chapter 1 Introduction and Background
Pseudocode.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
Pseudocode.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
DCT 1123 Problem Solving & Algorithms
CIS Computer Programming Logic
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Control Structures (A) Topics to cover here: Introduction to Control Structures in the algorithmic language Sequencing.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Intermediate 2 Computing Unit 2 - Software Development.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
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.
Controlling Program Flow with Decision Structures.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Chapter 1: Introduction to Computers and Programming
Chapter 1 Introduction 2nd Semester H
Bill Tucker Austin Community College COSC 1315
Unit 2 Technology Systems
BASIC PROGRAMMING C SCP1103 (02)
Algorithm & Flowchart.
Introduction to Algorithms
1-1 Logic and Syntax A computer program is a solution to a problem.
Key Ideas from day 1 slides
BASIC PROGRAMMING C SCP1103 (02)
Chapter 2: Input, Processing, and Output
Chapter 2 Client/Server Applications
Topics Introduction to Repetition Structures
Data Types, Identifiers, and Expressions
Chapter 1. Introduction to Computers and Programming
The Selection Structure
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.
JavaScript: Functions.
An Introduction to Visual Basic .NET and Program Design
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 2 Applications and Data.
ALGORITHMS AND FLOWCHARTS
Chapter 8: Introduction to High-Level Language Programming
Data Types, Identifiers, and Expressions
Programming Funamental slides
Programming Right from the Start with Visual Basic .NET 1/e
Programming Funamental slides
Lecture Notes 8/24/04 (part 2)
ALGORITHMS AND FLOWCHARTS
CIS 16 Application Development Programming with Visual Basic
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
Chapter One: An Introduction to Programming and Visual Basic
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Value-Returning Functions: Generating Random Numbers
Chapter 2: Input, Processing, and Output
Basic Concepts of Algorithm
Introduction to Programming
Introduction to Pseudocode
Presentation transcript:

Chapter 3 Program Design 954240 Web Programming Chapter 3 Program Design 954240 Web Programming Modern Management and Information Technology College of Arts, Media and Technology, Chiang Mai University

Contents Creating an Input, Processing, Output (IPO) chart 954240 Web Programming Contents Creating an Input, Processing, Output (IPO) chart Designing the User Interface Developing an Algorithm

Creating an Input, Processing, Output (IPO) chart

Input, Processing, Output (IPO) chart It helps to write the program's inputs, processes and outputs as a list or table, An IPO chart makes it easier to think about the design for your algorithm.

Input, Processing, Output (IPO) chart 954240 Web Programming Input, Processing, Output (IPO) chart Example: IPO listing for a circle calculation program Inputs: radius Processing: receive the radius from the user calculate the area calculate the circumference display the radius, area and circumference Outputs: radius, area and circumference Radius – รัศมี circumference - เส้นรอบวง

Designing the User Interface

Designing the User Interface 954240 Web Programming Designing the User Interface Once we have an idea of inputs, outputs and processes, the next step is to design the user interface (also known as storyboarding) Designing the interface helps us to plan our algorithm because it is common to design different parts of a program (the program modules) around each screen of an interface

Designing the User Interface Example : The proposed design for the Circle Calculation interface Source: Mike O’Kane (2011) A Web-Based Introduction to Programming

Designing the User Interface 954240 Web Programming Designing the User Interface For more complex applications, the design phase is extensive. Programs will be broken down into a large number of different modules and screens. The work of software design is undertaken by senior programmers, while junior programmers develop the design into working code

Designing the User Interface 954240 Web Programming Designing the User Interface Once you have a clear idea of your interface, it is useful to go back to your customer and review the requirements That's because people can think more clearly about what they want when they see what the product will look like Frequently, customers will clarify their needs when they see the interface design

Developing an Algorithm

Developing an Algorithm 954240 Web Programming Developing an Algorithm When we design an application, we usually write our algorithms in English (We call this style of writing pseudocode) From the previous topic, we designed our Circle application in two components, so we will develop the algorithm for each component separately

Developing an Algorithm 954240 Web Programming Developing an Algorithm Here are the instructions for the first screen (circle.html) that provides a form for the user circle.html algorithm: Prompt the user for radius Get the radius Submit the radius to circle.php for processing END Prompt = reminds the programmer that the user must be provided with a message in order to know what to do Get = = reminds the programmer to provide some ways for the input to be received (ex. insert a drop-down list, input box)

Developing an Algorithm 954240 Web Programming Developing an Algorithm Here is an algorithm for the PHP program (circle.php) that uses the radius (from the user) to calculate and display the results circle.php algorithm: Receive the radius from circle.html area = PI * square (radius) circumference = 2 * PI *radius Display radius, area circumference END

Developing an Algorithm 954240 Web Programming Developing an Algorithm Look at the two calculations in our algorithm: These statements contain program variables, assignments and arithmetic expression area = PI * square (radius) circumference = 2 * PI *radius

Developing an Algorithm 954240 Web Programming Developing an Algorithm Variables Computer programs must store data in memory, so the program can access it later Every storage location in a computer's memory is identified by a unique numeric address Rather than refer to these addresses directly, we should create and use variable

Developing an Algorithm 954240 Web Programming Developing an Algorithm Variables Each variable has a name that represents the location in memory where a specific data value is stored area = PI * square (radius) circumference = 2 * PI *radius Variables การตั้งชื่อตัวแปร : ต้องไม่มีช่องว่าง

Developing an Algorithm 954240 Web Programming Developing an Algorithm Assignment Operations An instruction to store a value in a variable is known as an assignment operation Assignment operation are written by the variables that is to receive a value on the left side of the assignment operator (=) Assignment Operations ก็คือ การกำหนดค่า โดยจะใช้เครื่องหมาย =

Developing an Algorithm 954240 Web Programming Developing an Algorithm Arithmetic Expression An arithmetic expression is an arithmetic operation that generates a numeric result For example, 3+2 is an arithmetic expression Arithmetic expression can also include variables and the combination of variables and numbers So, radius*radius is an arithmetic expression and radius * 2 is also an arithmetic expression

Developing an Algorithm 954240 Web Programming Developing an Algorithm Logical Expression Logical expression (also called Boolean expression), is used to compare values and has a True or False result. For example, radius < 20 is a logical expression which tests whether the value of radius is less than 20 or not