COSC 1315 - Fundamentals of Programming
Allan Kochis


Chapter 2


  1. IPO Charts
    Input Processing Output
         


  2. Problem Solving Process
    1. Analyze the problem also call ed the specification.
      1. In practice this is the hardest step.
      2. The specification drives everything else.
      3. When Ford produced Pintos, the manufacturing plant produced the cars according to the specification.
      4. In this course the complete specification for the assignments and examples will be clear and unambiguous. This is rarely the case outside of academia

    2. Plan the Algorithm Also called the design step
      1. Top - down.
      2. Decomposition
      3. Abstraction
      4. Rapid Prototyping.

    3. Desk Check the Alogrithm

    4. Code the Algorithm also called Implementation
      1. Bottom - Up Implementation
      2. Function stubs.
      3. Function Drivers.
      4. Hollywood style of tackling functions.


    5. Desk check program

    6. Evaluate and modify the program, the iceberg effect.

  3. Bumper Sticker Computer Science

  4. Examples.

  5. Exercise #1 page 61.
    Input Processing Output
    Number
    Start

    Get a Number

    Compute the Square of Number
        as Number * Number

    Display the Square of the Number.

    Stop
    Square of Number

  6. Exercise #3 Pages 61.
    Input Processing Output
    Sales
    Rate

    Start

    Get the Rate

    Get the Sales

    Compute the Commission as
       Sales * Rate

    Display the Commission

    Stop
    Commission

  7. Exercise #5 page 62.
    Input Processing Output
    Number
    Start

    Get a Number

    If Number less than or equal to 0
       Display Error Message
    Otherwise
       Compute the Square of Number
          as Number * Number
       Display the Square of the Number.
    EndIf

    Stop
    Square of a number

  8. The the Squares of the numbers between 10 and 20.
    Input Processing Output
     
    Start

    Number = 10

    While Number less than 20
       Compute the Square of Number
          as Number * Number
       Display the Square of the Number.
       Add 1 to Number
    EndWhile

    Stop
    Squares

    Does this work correctly?