0% found this document useful (0 votes)
4 views

COMPROG LESON 1, 2, 3

The document outlines basic programming concepts, including the programming process, data processing cycle, and program development stages such as understanding the problem, developing solutions, implementation, testing, documentation, and maintenance. It explains the role of programming languages, compilers, and interpreters, as well as the formulation of program logic using algorithms, pseudocode, and flowcharts. Additionally, it discusses program structures and control flow, including sequential, selection, and iteration logic.

Uploaded by

jennylyndionecio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

COMPROG LESON 1, 2, 3

The document outlines basic programming concepts, including the programming process, data processing cycle, and program development stages such as understanding the problem, developing solutions, implementation, testing, documentation, and maintenance. It explains the role of programming languages, compilers, and interpreters, as well as the formulation of program logic using algorithms, pseudocode, and flowcharts. Additionally, it discusses program structures and control flow, including sequential, selection, and iteration logic.

Uploaded by

jennylyndionecio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

LESSON 1 enabling us to develop the logic of the

program. Tools that will help in this task are


Basic Programming Concepts
✓ Algorithm /pseudocode,
Programming- It is a process which involves ✓ Flowcharts, and
planning, scheduling or performing of a task or an ✓ structure charts.
event. 3. Implementation
- Given the detailed design of the solution,
Computer Programming - It is the process of
this process involves writing the source
writing instructions to perform specific actions in a code.
computer, and instructs the machine on how to 4. Testing
perform in order to solve problems.
- The process of finding and correcting errors
Data Processing Cycle in your program(debugging) Bug is used to
refer to any error in a program It involves
- is a set of steps the computer follows to tracing(simulating) where the information
receive data, process the data according to went and how it was processed.
instructions from a program, display the ➢ Two Types of Testing
resulting information to the user, and store 1. BLACK BOX TESTING - Testing
the results. the program without knowing what
(Information Processing Cycle) is inside it-without knowing how it
works. Test plans are developed by
looking only at requirements
statement and then be used when the
DATA PROCESS INFORMATION
system is tested as a whole.
2. WHITE BOX TESTING - Testing
(Information Processing Cycle) the program by assuming everything
about the program, making sure that
every instruction and every possible
situation has been tested.
5. Documentation
- When the program is finished and
thoroughly tested, the documentation on the
program is included for its distribution. It
usually includes necessary information
about the requirements of the program –
operating system and hardware requirements
Program Development Process needed for the program to run.
1. Understanding the Problem 6. Maintenance
- The first step is to get a clear idea of what - Maintaining or updating the program,
you want to do. You need to know what kind keeping the program running smoothly and
of input to expect, how the input is to be updated with the developments and changes
processed, and what kind of output is in the field where it is used
required. Programming Languages
INPUT – PROCESS – OUTPUT
- A programming language is a vocabulary
2. Develop the Solution and set of grammatical rules for instructing a
- To solve the problem, you will need detailed computer or computing device to perform
plans, a plan of what is to be done and when, specific tasks.
- Each programming language has a unique to as imperative programming and known as
set of keywords (words that it understands) top-down language.
and a special syntax for organizing program ➢ Object-Oriented Programming (OOP) - is
instructions. an approach to problem solving where all
➢ SYNTAX - set of grammatical rules for computations are carried out using an object
writing any statement in a programming as the basic unit. An object is an element of
language a program that sees how to perform specific
➢ SEMANTICS - meaning associated actions and how to interact with other
with the statement/code components of the program. An example of
an object would be a person with attributes
Compilers and Interpreters
such as name, height, weight. It is expected
1. COMPILERS - A compiler is required to for a person to be able to do something, such
translate a program written using a as walking, running, etc. defined as the
programming language into a machine- method of the object.
readable form or known as binary code)
before you can run the program on your
machine. LESSON 2
2. INTERPRETER - An interpreter to
Program Logic Formulation
translate the high-level instructions into
machine-understandable instructions (binary - It is the process of coming up with the
code) at runtime. appropriate methodology in developing a
specific program logic that will perform a
Regardless of what language is used, the program
prescribed computing task or solve a
must eventually be converted into machine
problem using the computer.
language so that the computer can understand it.
- In Etymology “Logic” is a method of human
thought that involves correct thinking in a
linear, step-by-step manner about how a
problem can be solved. Hence, the important
element must conform to define logic and
that is correct thinking or reasoning of the
✓ Source Program - The original program person
that is written in a high-level language
✓ Object Program - The machine language Tools in Logic Formulation
version of a program • Algorithm/Pseudocode - An algorithm is a
✓ Compiler - takes the program code (source set of well-defined instructions to solve a
code) and converts the source code to a particular problem. It takes a set of input(s)
machine language module (called an object and produces the desired output.
file). - Pseudocode is a simpler version of
Programming Paradigm programming code in plain English, which
uses short phrases to write code for a
➢ Procedural Programming - is a list of program before implemented in a specific
instructions that tells the computer what to programming language
do incrementally. Procedural programming
can rely on procedures, also known as Typical algorithmic steps in solving a problem:
routines or subroutines. A process contains a 1. Initialize data. - Initialization responsible
series of computational steps to be carried for taking any preliminary actions that may
out. Procedural programming is also referred be required by a program.
2. Read/Input the data. - Input responsible 2. Symbols are interconnected using arrows.
for collecting the data that is used by the 3. Use comma to separate data and use
program to accomplish its task. semicolon to separate instructions.
3. Perform computations - Process 4. All the symbols except the diamond may
responsible for transforming the data from have only one arrow branching out but may
one form into a different form. have more one or more arrows branching in;
4. Display/Output Results - Output 5. Whenever circles are used, the symbol
responsible for presenting the processed leading to circle should flow to the symbol
input where a circle containing a similar character
• Flowchart - A diagrammatic or graphical is leading to.
representation that illustrates the sequence of 6. The sequence of procedure using symbols
operations to be performed to get the matters because it indicates the logical steps
solution of a problem. Flowcharting to be followed.
Symbols: 7. A flowchart may contain many symbols of
the same kind depending on the solution of
the problem.
8. There may be many steps of flowcharts to
solve one problem but the simplest
flowchart is advisable and most efficient.
Sample Problems
Problem 1: Design an algorithm that will
determine the sum of two numbers Data Process
sum of two numbers compute sum first number
second number or add the two numbers
Data
sum of two numbers - first number - second
number
Process
compute sum – or - add the two numbers

Flowcharting Guidelines:
1. A flowchart always begin with START and
is completed by END symbol
2. Selection/Conditional - The execution of
instructions by selection, wherein conditions
for a series of alternative statements are
evaluated to specify which instruction is to
be executed. In this way, the flow of the
program depends on the set of conditions
that are written.

LESSON 3
• Program Structures - are just a way to
specify flow of control in programs. Any
algorithm or program can be more clear and
understood if they use self-contained
modules called as logic or control structures.
It basically analyzes and chooses in which
direction a program flows based on certain
parameters or conditions. Basic types of
logic, or flow of control:
- Sequence logic, or
sequential flow
- Selection logic, or
conditional flow
- Iteration logic, or
repetitive flow
- Modular
1. Sequential - are performed in strictly
sequential manner, each step being executed
exactly once.
3. • Repetition/ Iteration /Loop Repetitive
/Iterative statements (loops) - allow a set
of instructions to be repeated or carried out
several times until certain conditions have
been met.
Two types: (1) count-controlled (2) condition –
controlled
✓ Count-controlled loop - The way the count-
controlled loop works is simple: the loop
holds a count of the number of times it runs,
and the loop stops when the count reaches
the specified count. 4. • Modular/Procedural - The approach is
sometimes called divide and conquer
because a large task is divided into several
This loop normally performs the following three smaller tasks that are easily performed.
actions:
Initialization : The control variable (counter) is
initialized to the starting value before the loop
starts.
Test : the loop terminating condition that checks
if looping should continue
Increment (or decrement)value by which the
control variable is modified at each iteration of
the loop.

✓ Condition-controlled loop - A condition-


controlled loop is used when it is not known
how many times iteration will need to occur.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy