0% found this document useful (0 votes)
26 views8 pages

Reviewer Intro To Comprog 1

The document provides an overview of computer programming, defining key concepts such as algorithms, programming languages, and the programming life cycle. It categorizes programming languages into low-level and high-level types, detailing their characteristics and examples. Additionally, it explains the importance of pseudocode and flowcharts in programming, as well as the steps involved in developing and testing a program.

Uploaded by

ishigamijp
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)
26 views8 pages

Reviewer Intro To Comprog 1

The document provides an overview of computer programming, defining key concepts such as algorithms, programming languages, and the programming life cycle. It categorizes programming languages into low-level and high-level types, detailing their characteristics and examples. Additionally, it explains the importance of pseudocode and flowcharts in programming, as well as the steps involved in developing and testing a program.

Uploaded by

ishigamijp
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/ 8

1

●​ Algorithm: A sequence of unambiguous,


REVIEWER
finite, and ordered instructions to solve a
INTRODUCTION TO COMPUTER problem.
●​ Program structure: Programs are often
PROGRAMMING divided into smaller parts (modules) to
●​ Computer programming: A method of reduce algorithm complexity.
giving computers instructions on what to ●​ Niklaus Wirth's definition: A program
do next. consists of algorithms and data structure.
●​ Instructions (code): Written by computer Various methods are proposed to improve
programmers to solve problems or the creation and maintenance of software.
perform tasks.
●​ End goal: To create something, such as a
PROGRAMMING LANGUAGE
web page, software, or a picture.
●​ Nature of programming: Described as a ●​ Programming language: An artificial
mix between art and science—technical language used to control the behavior of a
and analytical, yet creative. machine, particularly a computer.
-​ Purpose: Facilitates communication about
organizing and manipulating information
COMPUTER PROGRAMMING and expressing algorithms precisely.
●​ Computer programming: The process of ●​ Two Types of programming languages:
writing, testing, debugging, and 1.​ Low-level programming languages:
maintaining source code using a Includes First and Second Generation
programming language to perform specific languages.
tasks. 2.​ High-level programming languages:
-​ Purpose: To create a program that exhibits Includes Third, Fourth, and Fifth
a desired behavior (customization). Generation languages.
●​ Computer program: A detailed set of
instructions executed by a computer to
1.​ LOW LEVEL PROGRAMMING
perform a task or solve a problem.
LANGUAGE
●​ Programmer: A person who designs a
●​ Low-level programming languages: Closer
program, converts problem solutions into
to machine language, easier for computers
instructions, and tests the program for
to understand than for humans.
functionality.
-​ Machine code: The lowest level of
●​ Programming language: A set of words,
language, represented by 1s and 0s.
symbols, and codes enabling
-​ Assembly language: Programming with
communication between humans and
memory registers directly, using mnemonic
computers.
codes (abbreviations) instead of 1s and 0s.
-​ Examples of programming languages: C,
●​ Categories of low-level programming
C++, C#, Java, Perl.
languages:
-​ Key elements of programming languages:
-​ First Generation (Machine Language):
Programming Environment, Data Types,
Executed directly by the computer
Variables, Keywords, Logical and
processing unit, represented by 1s and 0s,
Arithmetical Operators, If-Else conditions,
highly hardware-dependent.
Loops, Numbers, Characters and Arrays,
-​ Second Generation (Assembly Language):
Functions, Input/Output Operations.
Uses mnemonic codes specific to each
2

computer type, making it easier to -​ 100 lines in 3GL can be reduced to 5–20
remember than machine code. lines in 4GL.
-​ Example in Assembly Language: -​ Used for database queries, report
-​ ORG 100h generators, data manipulation, web
-​ MOV AL, var1 development, and general-purpose
-​ MOV BX, var2 languages.
-​ RET -​ More user-friendly with icons, graphical
-​ VAR1 DB 7 interfaces, and English-like words and
-​ var2 DW 1234h phrases.
-​ Example: Visual Basic & othe Visual
Environment
2.​ HIGH LEVEL PROGRAMMING
LANGUAGE
●​ High-level programming languages: ●​ Fifth Generation Language (5GL):
Feature is to express algorithms in a way -​ Closer resemblance to the English
humans do, rather than executing like language.
machines. -​ Capable of translating human instructions
-​ Limitation: Requires programming skills to into code that a computer understands.
perform the logical sequence of -​ Asks for further explanations if confused
instructions. with user instructions.
●​ Very high-level languages: Created to -​ Based on solving problems using
solve the common problem of data constraints, rather than an algorithm
processing easier and faster. written by a programmer.
-​ Advantage: Easier to read, write, and -​ Used mainly in artificial intelligence and
maintain than low-level languages. neural networks.
●​ Translation: Programs must be translated
into machine language by a compiler or
interpreter. KEY POINTS
●​ Categories of high-level programming ●​ Computer programming is the act of
languages: writing computer programs, which are a
●​ Third Generation Language (3GL): sequence of instructions written using a
-​ Transformed programming in the early programming language to perform a
1960s. specified task by the computer.
-​ First to use the true English language, ●​ The source code of a program is written
much easier to use compared to low-level in one or more languages that are
languages. intelligible to programmers, rather than
-​ Uses a translator to convert the program machine code, which is directly
into machine language. executed by the central processing unit.
-​ Portable across different systems. ●​ Programming languages are used in
-​ Examples: FORTRAN, COBOL, Basic, computer programming to implement
Pascal, C, C++, Java. algorithms. Most programming
languages consist of instructions for
computers.
●​ Fourth Generation Language (4GL): ●​ The description of a programming
-​ Closer to human languages than typical language is usually split into the two
high-level languages. components of syntax (form) and
-​ Simplifies 3GL by reducing the number of semantics (meaning).
instructional statements.
3

●​ Machine language is made up of a series mnemonics into opcodes.


of 0's and 1's. Each 0 or 1 is known as a ●​ Assembly language - is a low-level
bit (short for binary digit). A group of programming language for a computer,
eight bits, known as a byte, represents microcontroller, or other programmable
one character (i.e., a number or a letter). device, in which each statement
●​ Assembly language is not a single corresponds to a single machine code
language, but rather a group of instruction.
languages because each processor ●​ Machine language - sometimes referred
family has its own assembly language. as machine code or object code, is a
collection of binary digits or bits that the
DEFINITION OF TERMS computer reads and interprets.
●​ Computer programming - is the process ●​ Mnemonic - is a symbolic name for a
of designing and building an executable single executable machine language
computer program to accomplish a instruction (an opcode), and there is at
specific computing result or to perform least one opcode mnemonic defined for
a specific task. each machine language instruction.
●​ Computer program - is a collection of
instructions that can be executed by a
computer to perform a specific task.
Procedural Languages
●​ Debugging - is the process of finding and
resolving bugs (defects or problems that ●​ Uses a series of instructions or
prevent correct operation) within statements sequentially from
computer programs, software, or beginning to end.
systems. ●​ Execution of instructions is line by line,
●​ Source code - is any collection of code,
terminated after the last instruction.
with or without comments, written
●​ Examples: BASIC, COBOL, Pascal,
using a human-readable programming
language, usually as plain text.
FORTRAN, C, PL/1.
●​ Algorithm - is a finite sequence of
well-defined, computer-implementable
instructions, typically to solve a class of Non-Procedural Languages
problems or to perform a computation. ●​ Considered object-oriented
●​ Programming language - is a formal
programming languages.
language comprising a set of
●​ Event-driven, meaning a programmer
instructions that produce various kinds
of output.
selects an event that triggers the
●​ Semantics - is the field concerned with execution of instructions.
the rigorous mathematical study of the ●​ Different from procedural languages
meaning of programming languages. as statements are executed as a whole
●​ Syntax of a computer language - is the when an event occurs, not line by line.
set of rules that defines the ●​ Examples of events: click, double click,
combinations of symbols that are drag and drop, mouse over, etc.
considered to be correctly structured
●​ Examples: Visual Basic, C++, Java,
statements or expressions in that
Delphi.
language.
●​ Assembler - creates object code by
translating assembly instruction
4

there will be instances that it does not


PROGRAMING LIFE CYCLE
meet the requirements of the program.
●​ A computer is a problem-solving tool. Testing the program involves three
Once it is properly provided with a phases:
valid program, the computer becomes
4.1. Desk checking - is the phase when
self-operational, that is, it requires no
the programmer just mentally traces or
human intervention during processing.
checks the logic of the program to
To use this tool effectively, the
make sure that it's error-free.
programmer usually has to perform
the following set of well-defined steps: 4.2. Translation - is the phase when the
1.​ Identifying the problem: It is the first programming language uses a
step in creating a program. It involves translator to ensure that the
determining the requirements of the programmer did not violate any
program to be able to come up with a language rules by the chosen
suitable programming solution. programming language. This program
2.​ Planning the Solution: There are two translates the program line by line to
ways of planning the solution to a locate any syntax error.
problem, they are drawing a flowchart
4.3. Debugging - means detecting,
and writing pseudocode.
locating, and correcting bugs. In
-​ The flowchart is a graphical
programming, error or mistakes are
representation of the step-by-step
called bugs. In debugging phase, the
instruction to be done in a program.
programmer runs the program and
-​ Pseudocode is listing down the set of
uses dummy data or test data. Then,
instructions to be used in the program.
the programmer checks the flow of the
-​ These two approaches are not
program if its logic is error-free and if it
executable in a programming language.
meets the requirements of the
3.​ Coding the Program: Code the
specified program.
program with the use of a chosen
programming language. 5.​ Documentation: In this step, the
-​ If human language follows grammar in programmer makes a detailed
writing and speaking, programming description of how the program was
languages have their own set of rules created. It contains a brief narrative
to follow, this is called syntax. process undergone by the program,
-​ Violation of the rule set by the from the identification of the problem,
programming language used in a planning of the solution through
certain program will produce an error flowcharting and pseudocode, coding
called syntax error. of the program up to the testing
-​ One of the common causes of syntax results. Codes used for the program
error is a misspelling. are also included in this documentation
4.​ Testing the Program: After coding the as a reference for the next
program, it is important to test if it is programmer who will upgrade the
running. If it runs properly, then it is designed program.
free from a syntax error, however,
5

PSEUDOCODE
●​ Pseudocode specifies the steps of the
algorithm using the language of control
structure. It is a compact and informal
high-level description of a computer
programming algorithm that uses the
structural conventions of some
programming language but is intended
for human reading rather than
machine reading.
●​ Example 1:
If student’s grade is greater than or
equal to 60
Algorithm
Print “Passed”
●​ An algorithm is a list of instructions for
carrying out some process step by Else
step. Algorithms executed by a Print “Failed”
computer can combine millions of
elementary steps, such as additions ●​ Example 2:
and subtractions, into a complicated Give variable num1 a starting value of
mathematical calculation. If an 5
algorithm is devised for a process, it
Give variable num2 a starting value of
can usually be done so in many
10
different ways.
●​ Properties of an algorithm: Add 7 to num2
-​ Finiteness: There is an exact number of Store the value num1 times num2 in
statements to be executed and has its variable num3
ending.
-​ Absence of Ambiguity: Statements are Store the value num2 minus num1 in
clearly described and defined. num2
-​ Sequence of Execution: The sequence Output num1, num2, and num3
of statements is done from top to
bottom.
-​ Input and Output: Unknown values FLOWCHART
must be identified and exact output ●​ A flowchart is a graphical or visual
must be defined. representation of the algorithm of the
-​ Effectiveness: The solution to the program. It was introduced by Frank
problem must be correct. Gilberth in 1921, and they were called
-​ Scope of Definition: Identify the scope “Process Flow Chart”.
of the problem. ●​ A flowchart is a diagram representing
the logical sequence in which a
6

combination of steps or operations is


4.​ Program Flowchart:
to be performed. It consists of labeled
-​ Shows controls over how a program
geometrical symbols that are
works within a system.
interconnected to provide a pictorial
-​ These flowcharts show any and all user
representation of a data processing
interaction pathways.
procedure. It can also be used to depict
-​ Program charts are large and complex.
the hardware associated with a
computer information system.
FLOWCHART SYMBOLS

TYPES OF FLOWCHART ●​ Actual program statements are written


inside the appropriate symbols.
The flowchart can be categorized into four
Flowchart symbols conform to the
main types.
International Organization for
1.​ Document Flowchart: Standardization (ISO) and American
-​ Shows controls over a document flow National Standard Institute.
through a system, such as payroll 1.​ Input/Output Symbol (Parallelogram):
information, internal memos, and -​ Represents an instruction to an input
office mail. or output device.
-​ The flowchart shows how a document 2.​ Processing Symbol (Rectangle):
passes from one part of the company -​ Used to represent a group of program
to another. instructions that perform a processing
-​ It contains minimal details. function of the program.
3.​ Decision Symbol (Diamond):
-​ Denotes a point in the program where
2.​ System Flowchart: more than one path can be taken.
-​ Shows controls on how the entire -​ Used to document points where, based
system works by demonstrating how on variable conditions, a branch to
data flows and what decisions are alternative paths is possible.
made to control it. -​ The path chosen depends on the
-​ A system flowchart combines all the answer to a question or the result of a
resources with the related processes. test inserted in the symbol.
4.​ Preparation Symbol (Hexagon):
-​ Used to represent an instruction or
3.​ Data Flowchart:
group of instructions that will alter or
-​ Shows controls over a data-flow
modify a program's course of
system.
execution.
-​ Illustrates how data passes through a
-​ Commonly used for operations such as
system and tracks the origin and end of
control, index register, initialization,
data.
switch setting, and indicating loops.
-​ More concerned with the movement of
5.​ Terminal Symbol (Oval):
data than how data is processed.
7

-​ Used to designate the beginning and -​ Added to flow lines to clarify confusing
end of a program or a point of layouts in the flowchart.
interruption.
-​ Can also be used to specify error
conditions, such as parity error checks
or detection of invalid characters.
6.​ Predefined Process Symbol
(Rectangle with Two Vertical Bars):
-​ A specialized process symbol that
represents a named operation or
programmed step not explicitly
detailed in the program flowchart.
-​ As a subroutine symbol, it is used when
a procedure needs to be repeated
several times.
7.​ On-page Connector (Small Circle):
-​ A non-processing symbol used to
connect one part of a flowchart to
another without drawing flow lines.
-​ Denotes an entry or exit from another
part of the flowchart and is used to
change the reading sequence of a
flowchart on the same page.
-​ Helps conserve space, reduce flow
lines in complex programs, and
eliminate cross lines, aiding in clearer
and better-organized flowcharts.
8.​ Off-page Connector (Small Pentagon):
-​ Used instead of the on-page connector
to designate entry to or exit from a
page when a flowchart requires more
than one page.
-​ Commonly used in complex flowcharts
that extend over several pages.
9.​ Flow Lines (Horizontal/Vertical Lines):
-​ Used to show the reading order or
sequence in which flowchart symbols
are to be read.
10.​Flow Direction Indicators
(Arrowheads):
-​ Used to show the direction of
processing or data flow.
8

Flowchart Notations
●​ Flowchart notations are symbols used 2.​ Variables:
inside flowchart symbols to denote ●​ In the flowchart, data should be
process or operation. indicated using variables, which are
the storage locations for data in a
computer program.
●​ Important Note: Lowercase letters
used as variables are different from
uppercase letters.
●​ Data that are not stored in variables
cannot be displayed on the output
screen.

Illustrative Problems on Simple Logic Flow:


In creating a program flowchart, follow the
steps of the programming life cycle.
1.​ Identifying the Problem:
●​ From the problem, identify the given
data.
-​ Given data: These are the data that are
specified or implied in the problem.
(Given should be SPECIFIC)
●​ Input: Data that will come from the
program user.
●​ Required: Data to be processed or
computed.
●​ Output: Data that will be displayed on
the screen.

You might also like