Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lesson 1 in Computer Programming 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Lesson 1

Cycle/Programming
ConceptProgrammin
g
1. Defining the problem (planning)
. The first step in defining a problem begins with
recognizing the need for information. The problem is
thoroughly analyze in order to determine what is required for
its solution. To understand and analysing the problem we
must conduct a study to the nature of the problem and must
define what are necessary outputs required of the program.
2. Designing a Solution
When the problem is defined properly, we can
start designing the solution to the
problem. In designing the solution, we must be able
to breakdown the problem into
several steps so that it is easier for us to solve the
problem in small pieces. This
sequence of steps for the solution to the problem is
called an Algorithm.
3. Writing the Program
After the programmer has defined the problem and
designed a solution, the next step is to write the program
in a specific programming language.
4.Compiling the Program
The instructions written in a programming
language such as C must be translated into machine
language before they can be executed.
5. Debugging the Program
In computers, debugging is the process of locating
and fixing or bypassing bugs (errors) in computer
program code or the engineering of a hardware device.
6. Testing the Program
It is the process of checking if a program actually
performs its functions as planned
7. Documentation of the program
Documentation consists of written descriptions and
explanations of programs and other materials
associated with an organization’s data processing system.
Documentation of a system and a program designs are
one of the most important requirements for success in data
Input- Process-Output
There are three veryCycle
common terms that are linked to
each other. They describe particular stages in
information handling. They are:

1. Input
Data has to flow into the system in some form.
Input is the data flowing into the system from outside

Example:
 A thermometer linked to the system provides data on
raw temperatures
 A financial service provider sends a stream of current
share prices to your computer
 A newspaper takes a news feed from a news wire
2. Processing
This will be the second stage where the information
flow is the input data being manipulated in some way. It is
the action of manipulating the input into a more useful form.

Example:
 The newspaper takes the pure text obtained from the news
wire service and creates a front page layout using pictures
and formatted text.
 The keystrokes being entered by the typist is converted into
ASCII format that the computer can understand.

3. Output is the information flowing out of the system. The


final stage in the information flow is normally to present the
information in a user-friendly way.
Example:
FLOWCHART
It is a tool for analyzing processes. It shows
arithmetic and logical or procedures required in solving a
computer problem. Special symbols are used to show
procedures. Symbols are connected to each other by
directional arrows that indicate the sequence of operations
as they are to be performed by the computer. Each
symbol represents a particular function and English terms
that shows the operation or activity represented by the
symbol.

PSEUDO-CODE
It is the art of expressing a program in a
short English phrases that is used to explain specific tasks
within a program’s algorithm. It should be written as a list
of consecutive phrases and indentation can be used to
show the logic in pseudo-code or the looping process.
BASIC SYMBOLS USED IN
FLOWCHARTING
Terminal Symbol/Block
The terminator symbol marks the staring or
ending point of the system. It usually contains
the work “start” or “end”.

Preparation/Initialization/Housekeeping Block
It is used to select condition to be initialize.

Input/output Block
It represents material or information entering or
leaving the system.

Action/Process/Sequence Block
A box can represent a single step, or and entire
sub-process within a larger process. It can
perform also any calculations to be done.

Flowlines
It signifies the process that is to be executed
next.
On Page Connector

It shows the entry or the exit point of the


flowchart
Decision Block
It signifies any decisions that are to be done.

Off page connector


It designates entry to or exit from one page when
a flowchart requires more than one page
Showing the flowchart and pseudo-
code in a borrowing a book
Elements of Style in Programming
The elements of style are much essential in the world of programming.
As a rules
in programming style, first understand clearly the problem then paraphrase
it like those
English statements and mathematical problems that were broken into
parts. Try to
identify what the problem is asking for then provide possible solutions.
Make use of what
you have listed then decide what key you will use to work your program
out.

The following is the sample outline.


Guidelines for a Well – Drawn Flowcharts

 Every flowchart has a Start and a Stop symbol.


 The flow of sequence is generally from the top of the
page to the bottom of the page. This can vary loops
which need to flow back to an entry point.
 Use arrow-heads on connectors where flow direction may
not be obvious.
 There is only one flowchart per page.
 A page should have a page number and a title
 A flowchart on one page should not break and jump to
another page
 The flowchart should be clear, neat and easy to follow
 The usual direction of the flow of a procedure or system
is from left to right or top to bottom
BASIC CONTROL STRUCTURES /
FORMS OF PROGRAM FLOW

Program Flow refers to the order in which


the individual statements, instructions or
function calls of an imperative or
functional program are executed or
evaluated. There are :
3 types of forms of program flow

1. Sequence – process is executed from


one to another in a straightforward manner.
https://www.youtube.com/watch?v=_1xT4zV8mKQ
1. Selection (branching) a choice is
provided between two alternatives. Using
a test to decide between alternative
sequences.

The logical expression is evaluated as


True or False. If the expression is
TRUE, a statement is executed. Then
the next statement in the program
sequence is executed unless
statement transfers control. If the
expression is FALSE, statement is not
executed. The next statement in the
program is executed.
https://www.youtube.com/watch?v=vOEN65
nm4YU
https://www.youtube.com/watch?v=AlEBMhx
reo0
https://www.youtube.com/watch?
v=r1BpraNa2Zc
3. Repetition ( looping) –
Repeating a sequence of
statements until some
condition is met.

https://www.youtube.com/watch?v=_1xT4zV8mKQ

You might also like