Logic Formulation and Introduction to Programming
What is Logic Formulation?
• basic steps
• implement a procedure
• top-down design
• flowcharts
• pseudocodes
Basic Control Structures
Sequence
Instructions are executed in the order they are written
Provides the building block for computer programs.
Shows a single action or one action followed in order (sequentially) by another.
Actions can be inputs, processes, or outputs.
Selection
• Conditional
• Branching
• Decision
• branches off to different instructions depending on whether a condition is met
• several blocks of program code is executed based on a test for some condition
• tells the program which action to take, based on a certain condition
• When a condition is evaluated, its result is either true or false
• If the result is true, one action is performed; if the result is false, a different action is performed
Single
Double
Multiple
Repetition
While
For
Do while
Unconditional Jump
Program jumps from one place to another
Structured programming forbids this structure
Program Development Life Cycle
• Implementation phase
• Provides an organized plan for breaking down the task of program development into manageable chunks
• Each of which must be successfully completed before moving on to the next phase
• Outline of each of the steps used to build software application
1. Analyze: Define the problem
o Be sure you understand what the program should do.
What the output should be – that is, exactly what the task should produce.
Identify the data, or input, necessary to obtain the desired output.
Determine how to process the input to obtain the desired output – that is, determine what
formulas or ways of doing things can be used to obtain the output
2. Design: Plan the solution to the problem
o Develop the algorithm
o Every detail, including obvious steps, should be considered
3. Choose the interface: Select and use objects
o Obtain Input
o Display Output will be displayed
o Create objects to receive the input and display the output
o Use appropriate command buttons and menus to allow the user control
4. Code: Writing using a Programming Language
o C++
o Visual Basic
o Java
o SYNTAX
5. Test and Debug . Locate and remove any errors in the program.
o Compilation
o Typing mistakes
o Algorithm flaws
o Syntax Error
o Logical Error
6. Complete the documentation: Organize all the material that describes the program.
o designed for future use
o internal documentation - statements in the program that are not executed, but point out the
purposes of various parts of the program
o detailed description of what the program does and how to use the program
o instruction manual and online help
o it should take place as the program is being coded
Flowcharting Symbols
Some Application Flowcharting Symbols
Flowcharting
The purpose of an application flowchart is to use symbols to give a general picture of what functions the computer
system should perform.
It reveals how many program are to be written, what reports or documents are to be produced, and the form and
source of the input data
It gives an overall picture of the application
Choosing the Interface
• Form Layout
Property table