JMU
Programming and Programs
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Review
Possible Audiences
Writing for the Audience
Languages
Programming Languages
Programs in Imperative Languages
A Conceptual Model of the Flow through a Program
A Visual Model of the Flow through a (Linear) Program
images/railroad_linear-program.gif
From Algorithms to Programs (in Higher Level Imperative Languages)
From Algorithms to Programs (cont.)
Simulating a Computer
Simulating a Computer (cont.)
images/device-simulator.png
  Algorithm CoursesReporter.
    Create an entity name courses.
    Store the number of courses you are taking in courses.
    Move your pencil to column 0.
    Write the value in courses.
  End Algorithm.
  
Before Starting the Programming Process
  1. Understand the relevant features of the programming language being used
  2. Understand the development environment being used
Steps in the Programming Process
  1. Understand the problem domain and specific problem
  2. Decompose the problem into parts
  3. Solve examples of each part of the problem by hand
  4. Understand any existing designs/components/modules
  5. Create a detailed design of the new components/modules
  6. For each new component/module:
    1. Implement the component/module (which will consist of algorithms and data structures) in the programming language being used
    2. Test the component/module
    3. If necessary, debug the component/module
  7. Test and debug the complete program
  8. Refactor the components/modules to improve the implementation and/or generalize the components/modules (to make them applicable in a wider variety of circumstances)
About You and the Programming Process
Learning to Program/Code