Overview of Computer Programming
Overview of Computer Programming
Programming
The Language of Computer
1. structured approach
2. object-oriented approach
structured approach
• Dividing a problem into smaller sub-problems is called structured
design. Each sub-problem is then analyzed, and a solution is obtained
to solve the sub-problem. The solutions to all of the sub-problems are
then combined to solve the overall problem. This process of
implementing a structured design is called structured programming.
The structured-design approach is also known as top-down design,
bottom-up design, stepwise refinement, and modular programming.
object-oriented approach
• Object-oriented design (OOD) is a widely used programming
methodology. In OOD, the first step in the problem-solving
process is to identify the components called objects, which
form the basis of the solution, and to determine how these
objects interact with one another.
/* This is a simple Java program.
FileName : "HelloWorld.java". */
class Hello
{
// Your program begins with a call to main().
// Prints "Hello, World" to the terminal window.
public static void main(String args[])
{
System.out.println("Hello, World");
}
}
•Lito is given 20 pesos allowance a week.
He saves 6 pesos and spends the rest for
his snacks. How much does he spend for
snacks in a week?
Program Development Process
Documentation
Maintenance
The Program Development Process
1.Algorithm
2.Pseudocode
3.Flowchart
Algorithm – a logical procedure or set of steps to be followed to
arrive at a solution to a problem, An algorithm is the breaking
down of a problem in simple steps in order to find the right
answer.
Examples :
Recipe in a cookbook
Choreography of a dance
Example:
Making a Soap
Step 1: prepare your workspace
Step 2: cut and weigh the soap base
Step 3: melt the soap base
Step 4: add the fragrance or essential oil
Step 5: add color to the melted soap
Step 6: stir the melted soap
Step 7: pour the soap in the mold
Step 8: Unmold the soap
Flow line
1. Input / Output symbol – represents an instruction
to an input or an output data
2. Processing symbol – is used to represent a group of
program instruction that perform a processing
function
3. Decision symbol – this diamond-shaped box
denotes a point in the program where more than
one path can be taken.
4. Preparation symbol – is used to represent an
instruction or group of instruction that will alter, or
modify a program’s course of execution
5. Terminal symbol – is used to designate the
beginning and the end of a program
6. Predefined process symbol – is a specialized process
symbol that represents a named operation or
programmed step not explicitly detailed in the
program flowchart
7. On-page connector – this is a non processing symbol
which is used to connect one part of a flowchart to
another without drawing flow lines
8. off-page connector – is used instead of the on-page
connector to designate entry to or exit from a page
when a flowchart requires more than one page
9. Flow direction indicators – are used to show the
direction of processing or data flow
10. Flow lines – are used to show reading order or
sequence in which flowchart symbols are to be read
3. CODING
The third step in development a program consists
of writing the program code. In this step, you write
computer instruction that carry out tasks described in
the program design. The computer instructions are
written in a computer language that allows you to
describe the program in a language close to English.
4. TESTING AND DEBUGGING
Testing is the process of checking that a program
actually does what you planned it to do. Debugging is
the process of correcting programming errors. Testing
and Debugging are related operations carried out at
various stages during coding and after coding is
complete.
5. Documentation
Documentation is written material used to describe a program.
Two categories of Documentation:
1. User Documentation – is a description in nontechnical terms, of
how to use the program.
2. Technical Documentation – is describe in technical term, how the
program is organized and how it operates.
6. MAINTENANCE
Maintenance involves repairing bugs that are spotted by
program user and making alterations of the program, often in response
to user request for improved operation or additional program features.
Program maintenance often must be carried out by a programmer
other than the one who did the original programming.