Download presentation
Presentation is loading. Please wait.
Published bySimon Owen Modified over 9 years ago
1
Chapter 1 Program Development Asserting Java © Rick Mercer
2
Program Development Goals Understand an example of program development Understand the characteristics of a good algorithm Understand how algorithmic patterns can help design programs
3
1.1 Program Development Program development can be defined in three steps: Analysis:Understand the problem Design: Organize the solution Implementation:Get the solution running Program development is the progression from analysis to design to implementation
4
Analysis Synonyms for analysis inquiry, examination, study Activities Read and understand the problem statement Determine test cases
5
Test Cases A program to compute your weighted average Course Grade from our syllabus 15% Labs 35% Projects 15% Test 1 15% Test 2 20% Final Determine three test cases: LabsProjectsTest 1Test 2FinalAverage
6
Design Synonyms of design: model, think, plan, devise, pattern, propose, outline We'll use these design tools: algorithms algorithmic patterns algorithm walkthroughs
7
Algorithms An algorithm is a set of activities that solves a problem An algorithm must: list activities that must be performed list the activities in the proper order
8
Algorithm to Bake a Cake A recipe (a.k.a. an algorithm) Preheat Oven Grease Pan Mix ingredients Place ingredients into pan place pan in oven remove pan after 35 minutes Switch some activities around... what happens if …
9
Algorithmic Patterns Pattern: Anything shaped or designed to serve as a model or guide in making something else. Algorithmic Pattern: Serves as a guide to help develop programs It represents a common type of action that occurs over and over again in programs A solution that can be used different contexts Th e Input/Process/Output (IPO) Pattern can be used. This IPO pattern will be used in our second lab and our first project and quite often in the future
10
IPO Algorithmic Pattern Pattern:Input/Process/Output (IPO) Problem:The program requires input data to generate the desired information Outline:1. obtain input data from user 2. process input data 3. output the results
11
Patterns ala Alexander " Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice." From A Pattern Language, Christopher Alexander, Oxford University Press, 1977
12
Example of Algorithm Design The design deliverable will be an algorithm The IPO patterns provides a guide to design a more specific algorithm : IPO ModelIPO applied to Chapter 1 Case Study I)nput Obtain the items that count for 127A P)rocess Compute the course grade O)utput Display the course grade
13
Refining Activities in algorithms We often need to refine one or more activities (algorithm steps). For example, Compute the course grade might now be refined with the mathematical addition + and multiplication * symbols
14
Implementation Synonyms for Implementation accomplishment, making good, execution Implementation deliverable: computer program Let's do it We'll use the programming language Java We'll use the Eclipse Development Environment
15
One test case with the math done 15% Labs 50 *.15 = 7.5 35% Projects60 *.35 = 21.0 15% Test 170 *.15 = 10.5 15% Test 280 *.15 = 12.0 20% Final90 *.15 = 13.5 In this test case, the weighted average is 7.5 + 21.0 + 10.5 + 12.0 + 13.5 = 64.5
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.