CS208 Software Programming - PowerPoint PPT Presentation


PPT – CS208 Software Programming PowerPoint presentation | free to view - id: 1da0c8-ZDc1Z


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

CS208 Software Programming


Use English-like statements to instruct the computer what to do ... Each programming language has grammar rules that specify: How the statements are formed ... – PowerPoint PPT presentation

Number of Views:10
Avg rating:3.0/5.0
Slides: 18
Provided by: pamsma


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: CS208 Software Programming

CS208 Software Programming

  • Software
  • Instructions that tell the computer what to do
    (ie. a program)
  • Instructions are written in a programming

Language Levels
  • Each type of CPU has its own specific machine
  • Other language levels were created to make it
    easier for a human being to write programs
  • machine language
  • assembly language
  • high-level language

  • Machine Language
  • Zeros and Ones
  • Bit representations are specific to a particular
    hardware architecture
  • Assembly Languages
  • Use mnemonics for operations and sometimes also
    for memory locations
  • Each assembly language is specific to a
    particular hardware architecture
  • Translated by an Assembler

  • High Level Languages
  • Use English-like statements to instruct the
    computer what to do
  • Are more portable (will run on different kinds of
  • Are easier for humans to understand and program
  • Translated by a Compiler

Programming Language Capability Requirements
  • Representation Storage (of both the Data and
    the program Instructions)
  • Data Processing (Interprets the program
    instructions and carries out the operations
    defined by these instructions on the Data)
  • Data Input and Data Output
  • Input Data - data that is provided (is not
    computed) to the program as it runs
  • Output Data - data that the program ultimately
    produces (output data solution of the
    computational problem)

Example Languages
  • High Level Languages
  • FORTRAN - scientific/engineering, math
  • COBOL - business
  • BASIC - education and PCs
  • Pascal - education
  • C/C - application development
  • Java - application development

Program Development
  • Program development consists of
  • Discovering the underlying algorithm
  • Representing that algorithm as a program using a
    programming language

  • What is a program?
  • A collection of statements
  • Written in a programming language
  • Specify the steps taken to solve a problem
  • Each programming language has grammar rules that
  • How the statements are formed
  • How the statements are combined

High-Level Language Programming
  • Programming requires
  • A programming language (e.g. C) to express your
  • A set of tools to edit and debug your code
  • A compiler to translate your programs to machine
  • A machine to run the executable code on

Types of Code
  • Source code (source file)
  • Typed into the editor by the programmer using a
    programming language
  • Object Code (object file)
  • Translated from the source code by the compiler
  • Executable Code
  • Created by the linker - links the object code and
    any necessary library object code files together

Program Development
High-Level Language Program Development
Creating Computer Programs
  • Analyze the problem
  • Plan an algorithm
  • Hand check the algorithm
  • Code the algorithm (or write program)
  • Hand check (trace through) the program
  • Evaluate and modify program as necessary

Structured Programming
  • Structured Programming is a technique used to
    create well-formed programs
  • Uses top-down design with stepwise refinement
  • Larger pieces of code are broken into shorter
    pieces of code that encompass a single task
  • Task are repeatedly broken down into smaller
    tasks, until they are small enough to be
    understood easily

Structured Programming Concepts
  • Final program is created via top-down design.
  • Main code starts with empty modules, and is
    slowly refined to lowest level
  • Program is subdivided into modules (one logical
    task, generally no more than one page long)
  • Keeps programmer from being overwhelmed by the
    size of the job
  • Allows easy division of work (modules assigned to
    different programmers)

Structured Programming Concepts (continued)
  • Each module is organized into recognizable
    paragraphs, using indentation to show nesting and
    subordinate clauses.
  • Code structures should have only one entry point
    and one point of exit (no GOTO).
  • Embedded comments describe the function of each
    data item and purpose of each module.
  • Straightforward, easily readable code is
    preferred over slightly more efficient, but
    obtuse, code.

Benefits of Structured Programming
  • More readable
  • Easier to maintain
  • More flexible
  • More likely to be correct on first run
  • Easier to "prove" by systematic program
About PowerShow.com