0% found this document useful (0 votes)
16 views16 pages

Chapter 1 Basic Concepts and Logic Design

The document discusses computer programming concepts and terminologies. It covers topics like programming languages, logic formulation using flowcharts and pseudocode, and algorithms. Examples are provided to explain flowcharts and how to write pseudocode and algorithms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views16 pages

Chapter 1 Basic Concepts and Logic Design

The document discusses computer programming concepts and terminologies. It covers topics like programming languages, logic formulation using flowcharts and pseudocode, and algorithms. Examples are provided to explain flowcharts and how to write pseudocode and algorithms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

COMPUTER PROGRAMMING 1

LEARNING OBJECTIVES

• To describe programming concepts and terminologies.


• To understand the ideas, algorithms, logic, and pseudocode.
• To understand the steps in problem solving in programming.
BASIC CONCEPTS AND LOGIC DESIGN

1.1 Concept and terminologies

Computer today is a companion of every task in the society. It is used in personal


and business world that can able to do buying and selling products, increasing
knowledge, entertainment, decision making, communicating to the world,
transacting payments of bills and many more factor that we do today. But in order to
do that, computer application is needed. This application used in computer were
developed using the method of “Programming” and some concept in formulating
the so-called computer application. So what is programming and its concept? Let’s
start familiarizing the different terminologies in creating computer application.
• 1.1.1 Programming Technologies
A programming language is a special language that the programmer used in order
to give a set of instruction for a computer to execute and to develop a software
program. PL is a media of communication between human and computer.
examples of programming language:
• JAVA
• RUBY
• C#
• PHP
• C++
• VISUAL BASIC
• PERL
• Program – is a logical pattern of instructions to solve a problem. It is
also a series of coded instruction in performing operations for
computer task.

• Programming – is an art and science of designing a program.


Furthermore, it is the process where the algorithm is applying and
encoding it in a notation manner or a way that the computer will
understand like programming languages.

• Programmer – is a person who creates, developed, codes, test, debugs


(removing an error) and documents a computer program.
• Algorithm – is a step by step method for solving a computational problem. For
example, to compute the salary of the employees, the computer uses an algorithm.
To accomplish this task step by step process is needed to apply like from entering
of data to the result of the total salary.

• 1.1.2 Logic Formulation


• Logic – is from the greek word logos which is sometimes translated as “reason”.
It is the study of principles of correct reasoning. The process of coming out with
the basic steps to implement a procedure in computer programming is what we
called Logic Formulation. This is usually resorted to when having top-down
design. Flowcharts and Pseudocodes are the two of most common output of the
exercise.
• Flow chart – is an illustration that show the “flow” of a program. It is
used in many ways and one of the many ways is to solve a problem in
computer programming.
Flowchart Symbol Name (alternates) Description

Used as a start or stop point in a


process. It is also used as a point
of interruption or delay of a
terminator program.

Used for an operation or action


step like arithmetic operations
and data manipulation. It is also
Process used as a default symbol.
Flowchart Symbol Name (alternates) Description

A branch in the process or a


question. It is used for any logic or
comparison operations. The
Decision decision symbol has one entry and
two exit paths.

Indicates the direction of flow of


Flow line logic and used to connect symbols.

Used for input and output


operations like printing (displaying)
Input/ Output and reading.

Used to join the two flowlines. Or,


represents any entry from , or exit
Connector to, another part of the flowchart.

Used to indicate that the flowchart


Off-page Connector continues to next page.
Flowchart Symbol Name (alternates) Description

A formally defined sub-process. It


is used to represent a group of
statements that perform one
Pre-defined process processing task.

A collection of data, generally


stored and accessed in a computer
Database system.

Logical OR

Or

Logical AND
Summing junction
A document or report
Documentation
EXERCISE
• Example problems of flowcharts in programming

1. Draw a flowchart to add two numbers entered by the


users.

2. Draw a flowchart to find the largest among the three


different numbers entered by the user.
PSEUDOCODE

• Pseudocode describe as a simplified, half-English, half-


Code informal representation of computer program and
algorithm. Pseudocode use for clarification of the plan
and design of the program before the individual begin to
code. It is used to review the code easier without visiting
the source code.
PSEUDOCODE CAN BE BROKEN
DOWN INTO FIVE COMPONENTS
• Variables – has name, a data type, and a value
• Assignment – it is the physical act of placing a value into a
variable
• Input/Output – both deal with an outside source, receiving or
giving information
• Selection – construct allows for a choice between performing an
action and skipping. It is our conditional statements.
• Repetition: construct that allows instructions to be execute
multiple times
• Algorithm is a step-by-step
procedure, which defines a set of
instructions to be executed in a certain
order to get the desired output.
ALGORITHM Algorithms are generally created
independent of underlying languages,
i.e. an algorithm can be implemented
in more than one programming
language.
How to Write an Algorithm?

• We write algorithms in a step-by-step


manner, but it is not always the case.
Algorithm writing is a process and is
ALGORITHM executed after the problem domain is
well-defined. That is, we should know
the problem domain, for which we are
designing a solution.
How to Write an Algorithm?

Problem: Design an algorithm to add two numbers and


display the result
• Step 1 − START
ALGORITHM • Step 2 − declare three integers a, b & c
• Step 3 − define values of a & b
• Step 4 − add values of a & b
• Step 5 − store output of step 4 to c
• Step 6 − print c
• Step 7 − STOP

You might also like