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

Understanding Computer Programming 9&10

The document provides an introduction to computer programming, explaining the concept of a program as a set of instructions that a computer follows to perform tasks. It outlines the Program Development Life Cycle (PDLC), which includes phases such as problem definition, algorithm development, coding, testing, and maintenance. Additionally, it discusses control structures in programming and emphasizes the importance of ethics in computer programming, highlighting guidelines that programmers should follow to ensure responsible and fair practices.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Understanding Computer Programming 9&10

The document provides an introduction to computer programming, explaining the concept of a program as a set of instructions that a computer follows to perform tasks. It outlines the Program Development Life Cycle (PDLC), which includes phases such as problem definition, algorithm development, coding, testing, and maintenance. Additionally, it discusses control structures in programming and emphasizes the importance of ethics in computer programming, highlighting guidelines that programmers should follow to ensure responsible and fair practices.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 53

UNDERSTANDING

COMPUTER
PROGRAMMING
LESSON 1
Let’s Discover

Observe how smart


After buying in grocery phone works. Open
store? You proceeded a messaging app
to the checkout and type in letters
counter. What using the keyboard.
happened next? What happened?
PROGRAMMING
-We have seen how
computers and mobile
devices change how the
world moves. They perform
and automate tasks instantly.
PROGRAMMING
-Computers automatically scan
the barcode, calculate the total
price of the groceries, accept
the payment, and then
compute the change.
PROGRAMMING
-Smartphones, on the other
hand, display the letter that we
type, and then send the
message to the recipient as
soon as the Send button is
pressed.
EXAMPLES:
PROGRAMMING
These devices, however,
would not work without
something telling them
what to do. They follow a
program.
What is a Program?
A program is a set of specific
instructions that tells the
computer what to do. If done
correctly, the computer
executes the program.
What is a Program?
The process of creating a
set of instructions or
program is known as
PROGRAMMING. It is also
referred to as CODING.
PROGRAM DEVELOPMENT LIFE CYCLE

-Programmers follow a guide that


helps them create and develop
any type of program. This guide
is called program development
life cycle (PDLC). It involves five
phases.
1. Problem Definition and Analysis

-In this phase, we


determine the problem,
need, and output of the
problem.
1. Problem Definition and Analysis

-Afterward, we identify the


requirements needed to solve
the problem, such as variables,
data input from the user, and
limitations of the program.
EXAMPLE:

-The problem is how to


display the sum of two
numbers. In this program,
the output is their sum.
EXAMPLE:
-The requirements of this
program will include the user’s
output, giving any two numbers,
and the variables that will store
both numbers and their sum.
2. Algorithm Development

-After determining the problem and


its requirements, we then develop the
program’s algorithm. An algorithm
refer to the logical sequence of
steps and procedures to solve the
problem.
COMMONLY REPRESENTED IN TWO WAYS:

Flowchart- is a diagram
that represents the
algorithm. It contains
various shapes connected
by arrows.
COMMONLY REPRESENTED IN TWO WAYS:
COMMONLY REPRESENTED IN TWO WAYS:

Pseudocode- is a detailed
description in an easily
understandable language,
usually in English, and not in a
complicated programming
language.
COMMONLY REPRESENTED IN TWO WAYS:
EXAMPLE: DISPLAY THE SUM OF TWO
NUMBERS
START

Input # 1

Input # 2

Sum = # 1 + # 2

Print sum

End
-In both illustrations, the algorithm for the
problem is shown. The users inputs or enter
two numbers assigned as number 1 and
number 2 respectively. The sum of both
number 1 and number 2 calculated and
stored as sum. The program displays the
value of the sum, and the program is
executed.
3. Coding
-After developing the program’s
algorithm, we proceed to the actual
coding of the program. We have
previously defined a program as a set
of instructions. For the computer to
understand these instructions, we use
programming languages.
3. Coding
-In this phase, we use a
programming language to
“communicate” with the
computer. Programming
languages are also referred to
as codes.
Examples of Programming Languages:

Python, C + +, C#, and many


more. Python was created in
1991 by Guido van Rossum. It
is used for web and software
development
4. Testing and Debugging
-Now that the code has been
written out, we test is the
code works and displays the
correct output. If it does, the
code is correct
4. Testing and Debugging

-Otherwise, we take a look


at the code again and
check for errors.
5. Maintenance
-This phase involves users
actively using the program. In
this phase, we can still check for
improvements, enhancements,
or new problems in the program.
Control Structures
Programming
-A control structure shows
how instructions are
performed. Programs are not
always done one step after
another. Some programs may
Control Structures
Programming
Involve decision-making,
depending on a given value.
Other programs may have
to repeat instructions until a
certain condition is met
1.Sequential Structure
-Instruction is performed
sequentially; one after
the other. This is the
simplest of structures.
Sequential Structure
Do…
Wet Hair.
STRUCTURED
Do… ENGLISH
Apply Shampoo.

1st Statement
Do…
2nd Statement
3rd Statement Rinse

etc…
2. Conditional
Structure
-Also known as decision-
making structure, some
instructions may involve
decisions or conditions
before they are executed.
Conditional Structure
STRUCTURED
ENGLISH
Conditio
n

IF condition
Do… Do… THEN do
statement

Do statement
END IF
EXAMPLE:
Drive car

No
Light is
Red? Go

Yes

Stop
3. Iterative Structure
(looping)
-A certain set of
instructions is repeated
or looped a certain
number of times
Ethics in Computer
Programming
-Students and professionals
in computer programming
are expected to follow
ethical guidelines in
developing programs.
Ethics in Computer
Programming
-By following these
guidelines, programmers can
share good practices and
exhibit professionalism
toward another programmers.
Ethics in Computer
Programming
1. Contribute to society and
human well-being,
acknowledging that all
people are stakeholders in
computing
EXPLANATION
-A programmer must strive
to ensure the programs
they create will be used in
socially responsible ways.
Ethics in Computer
Programming

2. Avoid harm
to others
EXPLANATION
-A programmer must consider the
design, implementation, use, and
removal of software when making
decisions. He must follow the
standards of system design and
testing.
Ethics in Computer
Programming

3. Be honest
and trustworthy
EXPLANATION
-A programmer should
always be honest about his
or her system design,
including the problems and
limitations.
Ethics in Computer
Programming

4. Be fair and take


action not to
discriminate unfairly
EXPLANATION
-A programmer must not unfairly
discriminate based on age, color
or ethnicity, disability, status,
gender. He must treat people
with respect, equality and
tolerance.
Ethics in Computer
Programming

5. Respect the work


required to produce new
ideas, inventions, creative
works, and computing
articles.
EXPLANATION

-A programmer should
not violate copyright
law and give credit to
where it is due.
Ethics in Computer
Programming

6. Respect
Privacy
EXPLANATION
-A programmer should also
establish procedures to
allow the person to review
his or her personal data.
Ethics in Computer
Programming

7. Honor
Confidentiality
EXPLANATION
-A programmer should not
share personal
information of employers,
clients and users.
EXPLANATION
This principle pushes for the
nondisclosure of the nature
and content of any
information to appropriate
authorities.

You might also like