Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.

Similar presentations


Presentation on theme: "The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the."— Presentation transcript:

1

2 The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the program *

3 Define the Problem What do you want to solve? What is the objective? What is the question?

4 Define the Problem You need: Clear, specific statement of goal Expected output Expected input

5 Define the Problem You need to know: Constraints? Special conditions? Make a plan

6 Documentation improve readability you remember others understand maintenance

7 Design a Solution break the problem into smaller parts break subproblems into smaller solvable components do other solutions exist? pros and cons of each solution solve each subproblem integrate the solutions to the subproblems to solve the original problem * * * * *

8 Structured Programming Not one giant step Many small tasks Programmer concentrate on details Usually done in teams

9 Structured Programming Reduces time (and $) Different modules Errors isolated Design written in code

10 Introduction Dumb Machines Algorithms pseudocode structure charts flowcharts

11 PSEUDOCODE Logical steps Written in English Indenting for logical structures begin game display instructions pick a number between 1 and 100 repeat turn until number is guessed or seven turns are completed input guess from user respond to guess end repeat end game display end message

12 Flowchart Logical steps represented by standard symbols display instructions get number is number even? YesNo continue *

13 Test the Design Does it solve our problem? no- select another design - return to the analysis of the problem yes- move on

14 NO plan, NO help Implement the Design Lease creative part Choose a language Choose a language Write the code Write the code NO plan, NO help *

15 Design Example Linear Search Problem: Find the largest number in a list * Algorithm: call the 1 st is the largest call the 2 nd current (cont.)

16 Design Example Linear Search 1 while we are not finished 2 compare the largest to the current 3 if current > largest 4 label current as largest 5 call next number in the list current 6 repeat the while 7 output the largest * 5 call next number in the list current

17 Programming Languages Over 200 languages Language depends upon task COBOLLogo C++ADA PascalFORTRAN BASIC

18 Introduction Levels of Computer Languages: Low machine assembly

19 Introduction Levels of Computer Languages: High COBOL Pascal FORTRAN Logo

20 Introduction Levels of Computer Languages: Mid-level C C++

21 Introduction Procedural languages Object-Oriented languages (OOP)

22 Computer Can’t Understand C ++ COBOLFORTRANPascalBASICADALISP

23 Introduction Translation to Machine Language Interpreter Compiler linker

24 Introduction * source code compiler - h-files used object code linked to libraries.exe file

25 OOP Concepts Object-Oriented Programming (OOP) Polymorphism Inheritance Encapsulation

26 OOP Concepts Encapsulation Self-contained unit Data Abstraction Usable without knowing how it works

27 OOP Concepts InheritancePolymorphism *

28 OOP Concepts class = a user-defined data type A class contains variables called objects and functions called methods.

29 “I discovered I always have choices, and sometimes it’s only a choice of attitude.” Judith M. Knowlton


Download ppt "The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the."

Similar presentations


Ads by Google