Dept of Computer Science University of Maryland College Park

Slides:



Advertisements
Similar presentations
CS107: Introduction to Computer Science Lecture 2 Jan 29th.
Advertisements

1 CS101 Introduction to Computing Lecture 17 Algorithms II.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
CSC401 – Analysis of Algorithms Lecture Notes 1 Introduction
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Chapter 2: Algorithm Discovery and Design
Program Design and Development
A High-Level Model For Software Development
Chapter 2: Algorithm Discovery and Design
PRE-PROGRAMMING PHASE
Fundamentals of C programming
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Adapted from slides by Marie desJardins
Introduction to High-Level Language Programming
JS Arrays, Functions, Events Week 5 INFM 603. Agenda Arrays Functions Event-Driven Programming.
Algorithmic Problem Solving CMSC 201 Adapted from slides by Marie desJardins (Spring 2015 Prof Chang version)
Data Structures & AlgorithmsIT 0501 Algorithm Analysis I.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
The Software Development Life Cycle. Software Development SDLC The Software Development Life-Cycle Sometimes called the program development lifecycle.
ดร.สุรศักดิ์ มังสิงห์ SPU, Computer Science Dept.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
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.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
CS 100 Introduction to Computing Seminar September 21, 2015.
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 1 Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers.
MNP1163/MANP1163 (Software Construction).  Minimizing complexity  Anticipating change  Constructing for verification  Reuse  Standards in software.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
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
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
All materials copyright UMBC unless otherwise noted CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking.
Conditionals, Block Statements, Style
ICS 3UI - Introduction to Computer Science
EGR 115 Introduction to Computing for Engineers
Dept of Computer Science University of Maryland College Park
CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking Prof. Katherine Gibson Based on slides by Shawn Lupoli and Max Morawski at UMBC.
Algorithms and Problem Solving
3.1 Fundamentals of algorithms
String Comparison, Scanner
Computer Organization, Eclipse Intro
Dept of Computer Science University of Maryland College Park
Java Variables and Types
C++ Plus Data Structures
Dept of Computer Science University of Maryland College Park
ALGORITHMS AND FLOWCHARTS
Lecture 3 of Computer Science II
Switch, Rounding Errors, Libraries
Algorithm and Ambiguity
Understand the Programming Process
Unit# 9: Computer Program Development
Problem Solving Techniques
Component-Level Design
2008/09/22: Lecture 5 CMSC 104, Section 0101 John Y. Park
Understand the Programming Process
Algorithm and Ambiguity
Chapter 7 –Implementation Issues
Algorithms and Problem Solving
Flowcharts and Pseudo Code
An Introduction to Debugging
Analysis of Algorithms
Chapter 2. Problem Solving and Software Engineering
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Dept of Computer Science University of Maryland College Park CMSC 131 Object-Oriented Programming I Design Dept of Computer Science University of Maryland College Park This material is based on material provided by Ben Bederson, Bonnie Dorr, Fawzi Emad, David Mount, Jan Plane

Overview Flags Project Design

Flags Project Let’s talk about the Flags Project Example (our FlagMakerLecture.java) Shows the methods you need Notice the coordinate system

Java API Provides information about Java Classes/Interfaces http://docs.oracle.com/javase/8/docs/api/index.html Check the entry for the Color class

The Software Lifecycle (“waterfall”) What customers want New versions Requirements Evolution Bug fixes Design Maintenance What you plan to do Coding Deployment Delivery (documentation, etc.) Your program Testing Did you meet requirements?

The Software Lifecycle (actual) Requirements Evolution Design Maintenance Coding Deployment Testing

In the Real World, Requirements and Design Rule Getting requirements right is essential for successful projects FBI electronic case file (junked after $180m) IRS system upgrade in late 90s (junked after >$2bn) FAA air-traffic control (false starts, >$10bn spent) Good design makes other parts of lifecycle easier In “the real world” coding typically < 30% of total project costs A good design improves: efficiency (speed) efficiency (memory) ease of coding ease of debugging ease of expansion

Program Design There are many aspects to good design Architecture Modeling Requirements decomposition Pseudo-code In this class we will focus on latter

Designing Using Pseudocode So far we have focused on the syntax and semantics of Java As the complexity of problems increase you need a design strategy to solve such problems Several alternatives exist to come up with a solution to a problem. A popular one is Pseudocode Pseudocode: English-like description of the set of steps required to solve a problem When you write pseudocode you focus on determining the steps necessary to solve a problem without worrying about programming language syntax issues

Pseudocode for finding the minimum value Pseudocode Example Pseudocode for finding the minimum value Read number of values to process (call this value n) Repeat the following steps until the n input values have been processed Read next value into x If (x is the first value read) { currentMinimum = x } else { if (x < currentMinimum) } Print currentMinimum value Ask students to try to implement the program associated with the pseudocode.

Pseudocode Elements When writing pseudocode you need the following constructs: Input Output Assignments Repetition Structures Conditionals To help you with the design of pseudocode you can use the following syntax to represent the above constructs

Pseudocode Elements Input variable = read() e.g., x = read() Output print(variable) e.g., print(x) Assignment x = <value> e.g., x = 20, s = “Bob” Repetition while (expression) { OR do { stmts stmts } } while (expression)

Pseudocode Elements Conditional (3) Conditional (1) if (expression1) { stmts } else if (expression2) { … } else if (expressionN) { } else { } Conditional (1) if (expression) { stmts } Conditional(2) if (expression) { stmts } else { } Indicate to students they could use their own variation of pseudocode

How Good is Your Pseudocode Your code does not use language constructs that are particular to a programming language Anyone receiving the pseudocode will not need to ask you questions in order to transform the pseudocode into code (no matter what the target programming language is)

Algorithms are Important Dijkstra’s Algorithm for Shortest Path We may not be able to come up with it, but we can implement it Dijkstra designed it in 20 minutes without pencil and paper Dijkstra is a Turing Award Winner Turing Award http://awards.acm.org/homepage.cfm?srt=all&awd=140