Wednesday, April 6, 2011

Overall view

Programs
  • Program ia s list of instructions for the computer to follow to acomplish the task of processing data into information.

Programming
  • Programming, also known as software development, is a six-step procedure for creating the list of instructions.
  • The six steps are program specification, program design, program code, program test, program documentation, and program maintenance.

Software development

Step 1: Program Specification 
  • also called program definition or program analysis
  • requires that the programmer and end user to specify five items: program's objectives, desired output, input data required, processing requirements, and documentation
  • objectives is the problems you are trying to solve

Step 2: Program Design
  • plan a program, preferably using structured programming techniques
  • these techniques are top-down program design, pseudocode, flowcharts, and logic structures
  • in top-down design, major processing steps, called program modules, are identified
  • in pseudocode, a narrative expression of the logic of the program is written
  • in program flowcharts, graphic representation of the steps needed to solve the programming program is drawn
  • in logic structures, three arrangements are used in program flowcharts to write structured programs

Step 3: Program Code
  • writing the program is called coding
  • one of the best ways to code effective programs is to write so-called structured programs
  • Content-markup language: uses symbols, words, and phrases that instruct a computer how to structure information for display or processing
  • Programming language: uses a collection of symbols, words, and phrases that instruct computer to perform specific operations

Step 4: Program Test
  • debugging refers to the process of testing and then eliminating errors
  • running the program on a computer and then fixing the parts that do not work
  • programming errors are syntax errors and logic errors
  • Syntax error: a violation of the rules of the programming language
  • Logic error: occurs when the programmer uses an incorrect calculation or leaves out a programming procedures
  • Testing methods are
    • Desk checking
    • Manually testing with sample data
    • Attempt at translation
    • Testing sample data on the computer
    • Testing by a select group of potential users

Step 5: Program Documentation
  • Documentation: consists of written descriptions and procedures about a program and how to use it
  • carried on throughtout all the programming steps
  • typically within the program itself and in printed documents
  • all the prior documentation is reviewd, finalized, and distributed
  • important for users, operators and programmers

Step 6: Program Maintenance
  • to ensure that current programs are operating error free, efficiently, and effectively
  • activities in this step are operations and changing needs
  • Operations: concern locating and correcting operational errors, marking programs easier to use, and standardizing software using structured programming techniques
  • Changing needs: Programs need to be adjusted for a variety reasons, including new tax laws, new information needs, and new company plocicies as the changing needs is unavoidable

CHAPTER 14 PROGRAMMING AND LANGUAGES

PSEUDO CODE


An outline of a program, written in a form that can easily be converted into real programming statements. For example, the pseudocode for a bubble sortroutine might be written:

while not at end of list
compare adjacent elements
if second is greater than first
switch them
get next two elements
if elements were switched
repeat for entire list

Pseudocode cannot be compiled nor executed, and there are no real formatting or syntax rules. It is simply one step - an important one - in producing the final code. The benefit of pseudocode is that it enables theprogrammer to concentrate on the algorithms without worrying about all the syntactic details of a particular programming language. In fact, you can write pseudocode without even knowing what programming language you will use for the final implementation.

Pseudocode Example

This is the pseudocode for a Game of Monopoly, including one person's move as a procedure:
Main Procedure Monopoly_Game
    Hand out each player's initial money.
    Decide which player goes first.
    Repeat
        Call Procedure Monopoly_Move for next player.
        Decide if this player must drop out.
    Until all players except one have dropped out.
    Declare the surviving player to be the winner.

Procedure Monopoly_Move
    Begin one's move.
    Throw the dice.
    Move the number of spaces on the board shown on the dice.
    If the token landed on "Go to Jail,"
        then go there immediately.
    Else if the token landed on "Chance" or "Community Chest,"
        then draw a card and follow its instructions.
    Else
        follow the usual rules for the square (buying property,
        paying rent, collecting $200 for passing "Go", etc.).
    End one's move.

http://users.ece.utexas.edu/~valvano/assmbly/intro.htm



CITATION :