Planning for the Solution

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

Chapter 3: Modularization
Chapter 2: Modularization
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
8 Algorithms Foundations of Computer Science ã Cengage Learning.
Chapter 2- Visual Basic Schneider
Program Flow Charting How to tackle the beginning stage a program design.
Chapter 2: Input, Processing, and Output
Modules, Hierarchy Charts, and Documentation
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
The Software Development Cycle Defining and understanding the problem.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
Simple Program Design Third Edition A Step-by-Step Approach
Chapter 2: Beginning the Problem-Solving Process
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Lesson 3 McManus COP  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what.
Programming Concepts Chapter 3.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
The Software Development Process
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
ICS124 Session 8 Structured Programming 1. By the end of this section the student will be able to:  List the steps of a model Systems Development Life.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
The Hashemite University Computer Engineering Department
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.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
MIT App Inventor Lesson 3 Algorithms Variables Procedures.
Chapter 2: Input, Processing, and Output Starting Out with Programming Logic & Design by Tony Gaddis (with instructor modifications) 1-1.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Management Information System Section (211 NMA course) Introduction to Programming.
INTRODUCTION TO PROBLEM SOLVING
Exam 1 Review.
Chapter 2: Input, Processing, and Output
Chapter 2- Visual Basic Schneider
The Selection Structure
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
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.
An Introduction to Visual Basic .NET and Program Design
Computer Programming.
Chapter 2- Visual Basic Schneider
Chapter 1 Introduction(1.1)
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
Chapter 2: Input, Processing, and Output
Programming Logic and Design Eighth Edition
Presentation transcript:

Planning for the Solution COP1006 4/22/2017 Planning for the Solution Lesson 3 McManus COP1006 COP1006_03

Computers are Dumb! You have to tell them what to do what to use COP1006 4/22/2017 Computers are Dumb! You have to tell them what to do what to use in what order to do it and what to do if your user does not do what you want them to do! McManus COP1006 COP1006_03

Solutions Don’t reinvent the wheel! Use solutions that have been COP1006 4/22/2017 Solutions Don’t reinvent the wheel! Use solutions that have been already proven successful been created just to be reused McManus COP1006 COP1006_03

We take these into consideration every time we create a program. COP1006 4/22/2017 Solution Trade Offs Speed Readability Understandability Maintainability Reusability We take these into consideration every time we create a program. McManus COP1006 COP1006_03

How the Computer Stores Data COP1006 4/22/2017 How the Computer Stores Data Files Program – set of instructions Data – raw pieces of facts database records Data (fields) files McManus COP1006 COP1006_03

COP1006 4/22/2017 Hierarchy of a DBMS McManus COP1006 COP1006_03

Terminology Semantics Syntax The concept or idea of the item COP1006 4/22/2017 Terminology Semantics The concept or idea of the item Ex. The numeral three is an idea that humans have established representing the concept of three items Syntax The physical/visible representation of the idea Ex. “three” “3” McManus COP1006 COP1006_03

Organizing the Problem COP1006 4/22/2017 Organizing the Problem Tools Algorithms Problem Analysis Chart (PAC) Structure/Interactivity Charts Input Processing Output (IPO) Chart Flowcharts Hierarchy Charts But…first we have to understand the Software Life Cycle McManus COP1006 COP1006_03

Software Life Cycle The Waterfall Model Problem Definition COP1006 4/22/2017 Software Life Cycle The Waterfall Model Problem Definition Software & Architectural Design System Requirements Detailed Design Specifications Design Validation Coding* Testing/ Acceptance Operations/ Maintenance Indicates = reiterative steps after testing and verification of each phase *Implementation McManus COP1006 COP1006_03

Analyzing the Problem Understand the Problem COP1006 4/22/2017 Analyzing the Problem Understand the Problem Analyze the Requirements of the Problem Figure out what will be the outcome Very often we’re not given the inputs to a problem, only the desired output. McManus COP1006 COP1006_03

PAC Payroll Example Given Data Required Results Processing Required COP1006 4/22/2017 PAC Payroll Example Given Data Required Results Hours PayRate Gross Pay Processing Required Solution Alternatives GrossPay = Hours * PayRate Define the Hours Worked and Pay Rate as constants Define the Hours Worked and Pay Rate as variables Defined the Hours Worked and Pay Rate as input values McManus COP1006 COP1006_03

Structure Charts Don't we wish! Calculate Gross Pay COP1006 4/22/2017 Structure Charts Calculate Gross Pay Obtain Input Values Print Pay Check PR HRS GP Don't we wish! *Includes data flow McManus COP1006 COP1006_03

Interactivity Charts Don't we wish! Calculate Gross Pay COP1006 4/22/2017 Interactivity Charts Calculate Gross Pay Obtain Input Values Calculate Gross Pay Print Pay Check Don't we wish! Hourly Rate Hours Worked *Includes data flow McManus COP1006 COP1006_03

Input Processing Output (IPO) COP1006 4/22/2017 Input Processing Output (IPO) Input Processing Output Hours Worked Pay Rate Enter Hours Worked Enter Pay Rate Calculate Pay Print Pay Gross Pay (the pay check) McManus COP1006 COP1006_03

Flowchart Originally used to describe the entire program. COP1006 4/22/2017 Flowchart Originally used to describe the entire program. Now, used to define selection (decision) and repetition (looping) structures McManus COP1006 COP1006_03

Flowchart Symbols Flowlines Start/(End/Stop/Exit) Processing COP1006 4/22/2017 Flowchart Symbols Flowlines used when direction is in doubt Start/(End/Stop/Exit) Processing I(input)/O(output) Decision Begin End Calculate Gross Pay Print Pay Check More Employees? McManus COP1006 COP1006_03

Example Flowchart Zzzzz! Alarm goes off! Snooze Snooze or Off? Snooze COP1006 4/22/2017 Example Flowchart Zzzzz! Alarm goes off! Snooze or Off? Snooze = 9? Snooze < 9 Sleep or Get up? Sleep Ignore Alarm, Forget Boss, Forget Instructor – Probably creating a problem? Get Dressed. . . McManus COP1006 COP1006_03

COP1006 4/22/2017 Pseudocode Everything is included, but written in English rather than any one language’s syntax Useful for debugging Ex. Obtain PayRate Obtain HoursWorked GrossPay equals PayRate Multiplied by HoursWorked Print GrossPay McManus COP1006 COP1006_03

Documentation Internal External Written in different language styles COP1006 4/22/2017 Documentation Internal External Written in different language styles McManus COP1006 COP1006_03

Internal Documentation COP1006 4/22/2017 Internal Documentation Used to explain what is being done (and why) within the program Most often takes the form of comments within the program Written in Language that Programmer, not user, will understand ' Insert a new node in the binary search tree. ' If the root node is null, create the root node here. ' Otherwise, call the insert procedure of class TreeNo McManus COP1006 COP1006_03

External Documentation COP1006 4/22/2017 External Documentation Manuals or Help menus to assist the user Includes User Manuals System Manuals User must be able to understand… Make text bold Select the text you want to change. Click Bold on the Formatting Toolbar. McManus COP1006 COP1006_03

Debugging the Solution COP1006 4/22/2017 Debugging the Solution Walkthroughs Walking through the process to verify that the solution is solving the right problem and works correctly You can use any of the charts or Pseudocode for this step Helps find bugs McManus COP1006 COP1006_03

Coding After determining that the solution is correct COP1006 4/22/2017 Coding After determining that the solution is correct Select the appropriate language Code the program McManus COP1006 COP1006_03

Testing Test the coded solution COP1006 4/22/2017 Testing Test the coded solution Best done by someone other than the programmer McManus COP1006 COP1006_03

COP1006 4/22/2017 60% to 70% of all Faults found in large-scale software projects are specification and design faults. Where do most of these faults originate? Not fully understanding the problem and then creating a specification based on an erroneous problem definition. Industry’s high priority involves the development and use of techniques that will help find faults during the earliest phases. McManus COP1006 COP1006_03

Where to Place the Blame? COP1006 4/22/2017 Where to Place the Blame? Nowhere! It is not the purpose to place blame when a fault is found… Only to fix the fault! McManus COP1006 COP1006_03

With team development… COP1006 4/22/2017 With team development… new problems arise, such as: different styles of writing code, interface difficulties, different declared types (integer vs real) different understandings of the problem caused by communication problems, and even something as simple as the order in which variables are listed within a procedure’s call statement. McManus COP1006 COP1006_03

Next? Programming Structure McManus COP1006 COP1006 4/22/2017