Designing Programs.

Slides:



Advertisements
Similar presentations
Modular Design Using Subroutines (functions later)
Advertisements

User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Lecture 6: Software Design (Part I)
Chapter 3: Modularization
Design Concepts and Principles
Programming Logic and Design Fourth Edition, Introductory
Divide and Conquer Chapter 6. Divide and Conquer Paradigm Divide the problem into sub-problems of smaller sizes Conquer by recursively doing the same.
Reuse and Reusability (Chapter 8 of maintenance text) Steve Chenoweth CSSE 375, Rose-Hulman Based on Don Bagert’s 2006 Lecture Image from
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Structured Programming structured programming: A technique for organizing and coding computer programs in which a hierarchy of modules is used, each having.
Program Design and Development
CS 201 Functions Debzani Deb.
Understanding the Mainline Logical Flow Through a Program (continued)
Programming Fundamentals (750113) Ch1. Problem Solving
A452 – Programming project – Mark Scheme
CSC 395 – Software Engineering Lecture 15: Object-Oriented Design –or– Ask For Whom The Data Tolls.
Chapter 4 Sec. 4.1, 4.2, 4.4 Procedures (User-defined)
Engineering 1020 Introduction to Programming Peter King Winter 2010.
CS540 Software Design Lecture 8 1 Lecture 8: Structured Design Anita S. Malik Adapted from Schach (2004) Chapter 13 and Appendix.
Chapter 6 Functions 1. Opening Problem 2 Find the sum of integers from 1 to 10, from 20 to 37, and from 35 to 49, respectively.
DECOMPOSITION. KEY TERMS  Structured programming  Functionality  Structure Charts  Stepwise refinement  Modularity.
Making a great Project 2 OCR 1994/2360. Analysis This is the key to getting it right. Too many candidates skip through this section. It’s worth 20% of.
More with Methods (parameters, reference vs. value, array processing) Corresponds with Chapters 5 and 6.
Modular Programming. Modular Programming (1/6) Modular programming  Goes hand-in-hand with stepwise refinement and incremental development  Makes the.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Liang, Introduction to C++ Programming, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 6 Advanced Function Features.
1 Program Development l Problem definition l Problem analysis l Algorithm design l Program coding l Program testing l Program documentation.
1 5.4 Modular Design Top-Down Design Structured Programming Advantages of Structured Programming.
Data Structures Using C++ 2E
Software Engineering CS103 February 13, How Do You Solve Big Problems? Thousands of programmers Thousands of programmers Months or years of coding.
Introduction to C Programming CE Lecture 5 Program Design in C.
1 MODULAR DESIGN AND ABSTRACTION. 2 SPECIFYING THE DETAILS OF A PROBLEM INTO A RELATED SET OF SMALLER PROBLEMS.
08120: Programming 2: SoftwareTesting and Debugging Dr Mike Brayshaw.
How to develop a program CSE 160 University of Washington 1.
Creating the Work Breakdown Structure. INFO 638Lecture #22 WBS The goal of the project should be accomplished when all tasks in the WBS are completed.
SBED 1259 Teaching Methods Mathematics 2017
AP CSP: Creating Functions & Top-Down Design
How to develop a program
Algorithms and Problem Solving
Sorting Why? Displaying in order Faster Searching Categories Internal
Lecture 9- Design Concepts and Principles
CS 5010 Program Design Paradigms "Bootcamp" Lesson 12.1
Chapter 6 Functions.
Introduction to Programming
Using Algorithms Copyright © 2008 by Helene G. Kershner.
Algorithm development
CMSC201 Computer Science I for Majors Lecture 11 – Program Design
Using Algorithms Copyright © 2008 by Helene G. Kershner.
Problem Solving Techniques
Stepwise Refinement Eric Roberts CS 106A January 8, 2010.
Software Design Designing the overall structure (architecture) of a software system Designing small pieces of computation Designing non-automated processes.
OOP vs Structured Programming
Relations and Functions
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Qbasic Modular Programming.
Problem Solving and Algorithm Design
Lecture 9- Design Concepts and Principles
The Programming Process
How to develop a program
Cost Estimation Van Vliet, chapter 7 Glenn D. Blank.
Searching.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 7: Input Validation
Programming Fundamentals (750113) Ch1. Problem Solving
slides courtesy of Eric Roberts
ENERGY 211 / CME 211 Lecture 27 November 21, 2008.
Modules, Subroutines, Procedures, Functions, or Methods
CMSC201 Computer Science I for Majors Lecture 12 – Program Design
Presentation transcript:

Designing Programs

Approach Until Now Pick smallest meaningful step you can do Goto 1 Do it Test it Goto 1

New Approach Can I do it in ~10 lines? Yes: Do it No: Break the problem down into smaller tasks Define each in terms of input and output With each task, go to 1

Reasons For Functions Reuse code:

Reasons For Functions Create abstractions: Detailed Abstracted

When To Function Reusing same code in multiple locations Want to provide abstraction Existing code is too complex

How To Function A good function Does exactly one job

How To Function A good function Does exactly one job Has clear inputs/outputs

How To Function A good function Does exactly one job Has clear inputs/outputs Is the right length Probably Not Maybe Sure

Comparison Monolithic vs Modular…

Stepwise Refinement Take problem Break into subproblems With each subproblem: Can you implement it easily? Yes : Done No : Goto 1 with this problem

Building a Program Goal: Display month calendar given year, month

Break Down

Break Down

Break Down

Break Down

Break Down

Break Down

Break Down

Bottom Up Implement low level functions, test individually

Top Down Implement top level functions using stubs for lower level ones

Real World Development is cyclical Make plan Code to plan Learn stuff Goto 1