Friday, February 4, 2011

Weekly Reflection1 : Chapter1 : programming and problem solving

Algorithm

-a sequence of instrutions to solve a problem.
-it can be written in human language n programming language

example :
area of a rectangle



1. get the width of the rectangle
2. get the heigth of the rectangle
3. calculate using the formula area= width *heigth
4. display the answer


Pseudocode
-is an outline of a program,written in a from taht can easily be converted into real programming statements.

example:
  • read the width
  • read the height
  • set the area to the width multiplied by height
  • print the area
Flowchart
-is a graphic representation of the logic or steps in a program.

example:



Program Design
-divided in to two phase : problem solving phase, implementation phase



The Software Life Cycle
  1. analysis and specification of the task (problem definition)
  2. design of the software (algorithm design)
  3. implementation (coding)
  4. testing
  5. maintenance and evolution of the system
  6. obsolescence


Procedural programming
Approach specifying the steps the program must take to reach the desired state.
Using programming languange to create computer memor y locations.
Also know as routine , subroutines, methods, or functions.
Defines the variable memory location
Invokes a eries of procedure to input , manipulate, and output the values  stored in those locations.
Structured programming
Composed of simple , hierarchical program flow structure.
Three flow structure : sequential , selection, and repitition.
Sequential  refers to a sequence of statements executed in order.
Selection is executed depending on the state of the program.
Repitition is execute until the program reaches a certain tate of applied to every element of a collection.
Associated with a “top-down design” approach.


Object oriented programming
Is an extension of procedural programming.
Made up of states and methods (functions).
State of an  object are known as attributes.
Method(functions)to accomplish tasks.
The attributes and methods are encapsulated  into objects that are then used  much like real world objects.
Programmer are allowed to access to data or procedures only via a specified interface.

No comments:

Post a Comment