EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 1 Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers.

Slides:



Advertisements
Similar presentations
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Advertisements

Chapter 1 - An Introduction to Computers and Problem Solving
Programming System development life cycle Life cycle of a program
Fall 2007CS 225 Introduction to Software Design Chapter 1.
Chapter 3 Program Design and Branching Structures Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Algorithm Design CS105. Problem Solving Algorithm: set of unambiguous instructions to solve a problem – Breaking down a problem into a set of sub- problems.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
Chapter 1 Program Design
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
PRE-PROGRAMMING PHASE
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
COMP An Introduction to Computer Programming : University of the West Indies COMP6015 An Introduction to Computer Programming Lecture 02.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Introduction to High-Level Language Programming
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Software.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Writing a Program Chapter 1. Introduction We all “start” by learning how to code in some programming language. –With a small, hypothetical, and fairly.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Chapter 1 Introduction to Structured Design. Introduction  System  A combination of people, equipment, and procedures that work together to perform.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Chapter 2 Problem Solving On A Computer 2.1 Problem Solving Steps Solving a problem on a computer requires steps similar to those followed when solving.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1 Introduction to Software Engineering Lecture 1.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Introduction to Software Development. Systems Life Cycle Analysis  Collect and examine data  Analyze current system and data flow Design  Plan your.
Historical Aspects Origin of software engineering –NATO study group coined the term in 1967 Software crisis –Low quality, schedule delay, and cost overrun.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
1 Programming with MATLAB ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
Lecture 13: 10/10/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Basic problem solving CSC 111.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
Programming and Languages
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
EGR 115 Introduction to Computing for Engineers Designing The Battleship Game in MATLAB Monday 22 Sept 2014 EGR 115 Introduction to Computing for Engineers.
The Art of Programming. The process of breaking problems down into smaller, manageable parts By breaking the problem down, each part becomes more specific.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 6: Debugging in MATLAB Monday 15 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
The Hashemite University Computer Engineering Department
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 3 Friday 03 Oct 2014 EGR 115 Introduction to Computing for Engineers.
The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Lecture 2 Debugging,
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Problem Solving.  Similar to Solving Math Word Problem  Read the Problem  Decide how to go about Solving the Problem  Solve the Problem  Test the.
1 Week 1 Introduction, Writing a Program, Building a System Software Engineering Fall Term 2015 Marymount University School of Business Administration.
EGR 115 Introduction to Computing for Engineers
Verification and Testing
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Introduction to Problem Solving
Problem Solving Techniques
The Programming Process
Algorithms.
Introduction – “Writing A Program”
Software Development Chapter 1.
Presentation transcript:

EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 1 Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers

Lecture Outline Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Branching & Program Design  Top-down design  Pseudocode Slide 2 of 15

Branching & Program Design Top-Down Design – Five Design Steps Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers 1.Clearly state the problem to be solved  Carefully articulate the objectives 2.Define required inputs and outputs  Constraints/requirements 3.Design the algorithm to be implemented  Define a simple step-by-step procedure (pseudocode?)  Will use a top-down approach 4.Convert the algorithm into code (e.g., MATLAB, C, …)  Replace pseudocode with actual code 5.Test the resulting program  Verify and Validate the design (debugging?) Cant solve the problem If it is NOT understood!!! Goes-intos & Goes-outs! Slide 3 of 15

Branching & Program Design Top-Down Design – Step 1: Define the Problem Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers STEP 1: Clearly state the problem to be solved  Carefully articulate the objectives o If you can not clearly define the problem then you can NOT construct a coherent solution!!  Understand your target audience o Just myself? o My class / fellow engineering students? o Millions of consumers?  Frequency of usage o Just for this one homework assignment? o Throughout the term? o Daily for many years? Maintenance Implications. Very different audiences. Slide 4 of 15

Branching & Program Design Top-Down Design - Step 2: Define the Inputs/Outputs Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Step 2: Define required inputs and outputs  Constraints / requirements o How many inputs / outputs? o What type of inputs / outputs?  Data format(s)? o Valid range of the input variables?  How to respond to invalid inputs? » E.g., Select an Input between 1 and 10: 66 o Where will the input(s) come from?  Keyboard, file, real-time data, … o Where will the output(s) go to?  Screen-text, file, plot, … Slide 5 of 15

Branching & Program Design Top-Down Design – Step 3: Design the Algorithm Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Step 3: Design the algorithm to be implemented  Define a simple step-by-step procedure (pseudocode?) o Use natural language description NOT MATLAB code o May require multiple passes  Top-Down Algorithmic Decomposition o Break the problem down into smaller sub-problems o Define modules and sub-modules  These may also have individual I/O definitions!! Slide 6 of 15

Branching & Program Design Top-Down Design – Step 4: Convert Algorithm to Code Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Step 4: Convert the algorithm to code  Replace pseudocode with actual code o Divide and conquer!!  Build and test small pieces  Progressive integration!!  Final step is to “encode” the algorithm using the chosen programming language (e.g., MATLAB, C, Java, …) o This is NOT the 1 st Step!!!!!!!!!!! o E.g., Battleship Game – First step was NOT writing MATLAB code!!!!!  You may run into limitations of the chosen language. Slide 7 of 15

Branching & Program Design Top-Down Design – Step 5: Test the Program Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Step 5: Test the resulting program  Verify and Validate the design o Verification: Are we solving the problem correctly? o Validation: Are we solving the right problem?  Can be approached at a program level o More often conducted at a component/module level.  Regression testing o How do I determine the effects of an update/change?  I only made a small change!!! Famous last words!!  Step 5 is often the most time consuming of the five steps!! Slide 8 of 15

Branching & Program Design Top-Down Design – Design Flow Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers MATLAB coding is the 2 nd to last step!! Understanding the problem is the 1 st step!! The last step in the design flow is testing. Slide 9 of 15

Branching & Program Design Top-Down Design - Complex System Design Flow Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Design process for complex systems May include both hardware & software "Introduction to Rapid Software Testing" By Chris Brown, Gary Cobb, Robert Culbertson. Slide 10 of 15

Branching & Program Design Top-Down Design – Life Cycle of a Computer Program Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Alpha release  Objective: Identify and fix major bugs (typically internal audience)  First complete version  Similar to final testing after complete integration Beta release  Objective: Identify and fix minor bugs (typically external audience)  Engage outside testers for bugs  Similar to qualification or acceptance testing in aerospace industry Slide 11 of 15

Branching & Program Design Pseudocode Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers What is pseudocode?  The design process by which we "design the algorithm (and data structures)" by decomposing the problem into more manageable sub-problems. Pseudocode is one method to design the algorithm  It happens to be the method favored by the text  Other methods include: o Flowcharting o Data flow diagrams o Class diagrams Slide 12 of 15

Branching & Program Design Pseudocode – A Flowchart example Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Start Declare variable types READ hours, base pay rate, overtime pay rate Compute pay at base rate Hours > 40? Compute overtime bonus pay Add overtime to base PRINT results STOP Yes No Slide 13 of 15

Branching & Program Design Pseudocode – An Example Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers The prior example in pseudocode %READ in data: hours, base pay rate, overtime pay rate %Compute pay at base rate %IF hours > 40 %Compute overtime bonus %Add to base %Print results %END Slide 14 of 15

Next Lecture Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers Logic Operators Slide 15 of 15