You are on page 1of 5

LESSON 1:

INTRODUCTION TO PROGRAMMING

1. Computer- It is any device that is capable of processing data into information.


2. Program- The list of instructions that the computer must follow to be able to process data into
information.
3. Programming- The procedure of developing the detailed instructions for the computer. It is the
act of instructing computers to perform a task.” Or called coding. Programming can be done
using a variety of computer programming languages, such as C, C++ and Java.
4. Programming Languages- are set of syntax for instructing a computer to perform specific
tasks.
2 Types:
1. High level languages – are written in a form that is close to human language like C, C++,
Java, Python, Visual Basic, PHP, and JavaScript.
Advantages:

• Easier to modify as it uses English like statements


• Easier/faster to write code as it uses English like statements
• Easier to debug during development due to English like statements
• Portable code – not designed to run on just one type of machine

2. Low level languages – are used to write programs that relate to the specific architecture
and hardware of a particular type of computer. They are closer to the native language of a
computer (binary), making them harder for programmers to understand. Examples are
assembly language and machine code.
Advantages:
• Can make use of special hardware or special machine-dependent instructions (e.g.
on the specific chip)
• Translated program requires less memory
• Write code that can be executed faster

Programmers rarely write in machine code (binary) as it is difficult to understand.

5. Syntax – is grammatical rules of a programming language. If you did not follow correctly the
syntax of a specific programming language this will result to syntax error.
6. Syntax error is an error in the syntax of a sequence of characters. A program will not compile
or run until all syntax errors are corrected and the process is called debugging.
7. Debugging- or to debug a program means to identify and remove errors from a program.
8. Programmer- a person who creates programs or instructions for a computer.
Characteristics of a Successful Programmer:

1. Puzzle Solver – It is not easy to write a code, a huge a part of the coding process is trial
and error. It is frustrating and requires a lot of patience. If you enjoy the challenge of solving
a problem then you will become a successful programmer.
2. Always Learning - Programming, like almost all jobs involving computer technology, is
prone to extremely rapid changes. If you’re working in this field, you will have to be willing
to learn new stuff. That means refreshing and updating your skillset to fit the market and
technology as a whole at regular intervals. This is a vital skill to becoming a successful
programmer in the long term.
3. Curious - Even if things work after the first try, a good programmer still asks themselves why
that is. A good programmer always strives to understand how his work functions, because

that is how you make it better.

4. Self-disciplined- As a programmer, you’re going to be spending a good amount of time


behind a keyboard by yourself – whether there are other people in the room or not, you’ll
be “in the zone” (opposite of comfort zone). It’s important to be able to maintain that deep
work mode for a long time. That comes down to self-discipline.
5. Communication Skills- A successful programmer has a good written and communication skills.
6. Adaptable- A successful programmer is willing and able to deal with changes.
7. Logical Mindset- Being able to handle a problem in a logical, analytical way makes a good
programmer.

8. Love for Technology- Last but not least, a good programmer is very passionate
about technology. “Doing what you love” is the motto of a successful programmer.
9. The Five Step Process of Programming:
1. Defining the problem- Specifically, the task of defining the problem consists of
identifying what it is you know (input-given data), and what it is you want to obtain
(output-the result).

2. Planning the solution- Two common ways of planning the solution to a problem are to
draw a flowchart and to write pseudocode, or possibly both.

3. Coding the program - As a programmer, your next step is to code the program-that is,
to express your solution in a programming language. You will translate the logic from
the flowchart or pseudocode to a programming language.

4. Testing the program – to look for errors in a program and debug them.

5. Documenting the program - Documentation is a written detailed description of the


programming cycle and specific facts about the program. The wise programmer
continues to document the program throughout its design, development, and testing.

10. Program logic formulation is a step-by-step development of a solution to a given problem.


Three Tools Used:
1. Algorithm- is a step-by-step procedure to solve a problem. It uses natural language and
not programming language. It is a lot like a recipe (called a procedure) and tells your
computer precisely what steps to take to solve a problem or reach a goal. The ingredients
are called inputs, while the results are called the outputs.
Example of Algorithm to change a light bulb
Step 1: Turn off the power
Step 2: Allow the bulb to cool
Step 3: Use a ladder
Step 4: Remove the old bulb
Step 5: Insert the replacement bulb
Step 6: Switch on the power
Step 7: Dispose of your old bulb

2. Flowchart is a pictorial representation of a step-by-step solution to a problem. It consists of


arrows representing the direction the program takes and boxes and other symbols
representing actions. It is a map of what your program is going to do and how it is going to
do it. The American National Standards Institute (ANSI) has developed a standard set of
flowchart symbols.
Basic Flowchart – is a type of flowchart which is the most straightforward form to understand.

Usually, a small process of one functionality follows a basic flowchart/diagram of almost five steps

only.
Example:

Flowchart Components

Example of a simple flowchart for computer programming

An input number is taken and divided by 2. If the remainder is equal to zero, the number is even, else printed as

odd. A simple program flowchart is easily understandable.


3. Pseudocode- Set of instructions that mimic programming language instructions. It is an
English-like nonstandard language that lets you state your solution with more precision than
you can in plain English but with less precision than is required when using a formal
programming language. Pseudocode permits you to focus on the program logic without
having to be concerned just yet about the precise syntax of a particular programming
language. However, pseudocode is not executable on the computer.
Example:

Activity: Write an algorithm and a flowchart to the following problems. (20 points)
1. The process of baking a cake.
2. The process of getting the square root of a number.
3. Online enrollment procedure in PUP.
4. How to achieve a healthy body.
5. Getting the average grade of a student.

You might also like