Sie sind auf Seite 1von 10

INSTRUCTIONAL MODULE AND ITS COMPONENTS

(GUIDE)

COURSE Program Logic Formulation


DEVELOPER AND THEIR School: Tarlac State University
BACKGROUND Name of Faculty: Rovell F. Asidera
Department: College of Computer Studies
Email Address: rfasidera@tsu.edu.ph
Facebook: frend_390@yahoo.com
Contact no.: 09071252085

COURSE DESCRIPTION The course introduces the concepts of computing. It includes the
use of the different flow chart symbols, basics of decision control
structures, looping statements and the different number systems. 
COURSE OUTLINE Week 1 A. Programming Process, naming variables and
symbols
Week 2 B. Flow chart and pseudocode statements
Week 3 C. Evolution of programming models
Week 4 D. Unstructured Spaghetti Code
Week 5 E. Recognizing Structure
Week 6 F. Making Decision
Week 7 G. Logical Operator (AND and OR Logic)
Week 8 H. Decision Tables
Week 9 I. Midterm Exam
Week 10 J. Advantages of Looping
Week 11 K. Controlling Loops with counters and sentinel
values
Week 12 L. Nested Looping
Week 13 M. Avoiding Common Loops
Week 14 N. Using a for Loop and Posttest Loops
Week 15 O. Common Loop Application
Week 16 P. Binary Numbers
Q. Octal Numbers
Week 17 R. Decimal Numbers
S. Hexadecimal Numbers
Week 18 T. Final Exam

CHAPTER # 1
TITLE Programming Process, naming variables and symbols
I. RATIONALE Studying this module equips you with the knowledge of
Program Logic Formulation, its logical equation, computation,
evaluation and logical thinking.
INSTRUCTION TO THE USERS Read and understand the contents of the topics to be discussed
in this module. You may start using this module upon
instruction from your instructor or align it with the schedule
of the course outline. Closure activities and assignments are
provided in this module to test your knowledge and
understanding of the topics. For synchronous learners, your
closure activities are to be answered during the online
discussion, and assignments are to be submitted online when
your instructor tells you to do so. For asynchronous learners,
you are to submit your outputs to the closure activities, and
assignments (answer all), For the evaluation assessment test,
wait for further instructions from your instructor.
PRE-TEST
II. LEARNING After the duration of this module, the learner should be able
OBJECTIVES to:
a. Understand computer components and its operations
and learn the steps involved in the programming
process 
III. CONTENT What is Data?
A. PREPARATORY Data are raw facts and figures which are meaningless.
ACTIVITIES Real data may be characters, numbers, or images
Ex. 140lb
65 inches
Jack
Characteristics of data
 Data are the raw materials of information
 Data is a distinct piece of information
 Data must be disorganized or unprocessed

What is Information?
 Information is the simplified form of data.
 When the data is processed or organized it becomes
information.
 Approaches in Organizing data:
 Classifying
 Sorting
 Summarizing
 calculating
Ex. of Information
 The average height or weight of several people,
suppose 62 inch, is an information

Procedure vs. Computer Program


 Procedure is a logical sequence of actions, either
consciously or subconsciously, to carry out a certain
task or process.
 Elements of Procedure
 Action – the sequence of steps to be taken
 Data – the elements operated upon by the
action
 Order – specifies the logical arrangement of
the actions
 Language – the medium of communication

Computer and Program


 Computer is an electronic device designed to
manipulate data.
 Program is a set of instructions to carry out a
particular task.
 Computer program is a set of instructions which
directs computer to perform/carry out a particular task.
Elements of Computer Program
 Operation – define the series of actions to be followed
by the computer
 Order - specifies the logical arrangement of the
operations
 Data - the elements operated upon by the operations
 Language – the medium by which the operations are
communicated
Understanding the Programming Process
 Problem Analysis
 Program Design
 Program Coding
 Program Debugging and Testing
 Program Implementation and Maintenance

Problem Analysis
 It is the step wherein a good definition of the problem
are considered and the program specification are
developed.
E.x. Create a program that accept two numbers, and outputs
which is greater than the other. Otherwise output if both are
equal.
 Program specification is a document being prepared
as a part of system design which contain the
following:
 Program Background
 I/O Specifications
 Program Methodology
Program Design
 It is the stage where logical sequence/ arrangement of
operations for the solution have to be planned,
consistent with the program specifications.
 Algorithm is a written series of logical instructions
which accomplish solution to a problem.
 Algorithms are developed by using any of the program
design tools such as structure charts, flowcharts,
decision table, pseudo codes, etc.

Program Design Tools


 Commonly used program design tools:
 Structure/hierarchy chart - depicts the
overall organization of a program, it shows
how segments/modules are defined and how
they relate to one another
Program Design Tools
 Flowchart – it shows graphical presentation of
an algorithm
 also known by other names such as block diagram,
logic diagram, run diagram, flow diagram and system
chart

 Pseudo codes – it describes the logical flow of


the solution to a problem through the use of
English–like statements (structured English)

Program Coding
 Coding – is the process of writing the actual program
steps in the proper format for a particular
programming language
 Factors that may affect the programming language
used are:
 Suitability
 Integration
 Standards
 Portability
 Development speed

Program Testing and Debugging


 Testing – refers to the process of verifying the
accuracy or workability of the program
 Debugging – refer to the process of
locating/identifying and correcting the errors in the
program
 Two main types of errors:
 Syntax error – occurs when the programmer
has not followed the rules of the programming
language
 Logic error – occurs when running a program
produces incorrect results

Testing and Debugging


 Source code – a computer program before it is
compiled
 Object code – the machine language version of the
computer program generated after the program source
code is compiled
 Compiler – is a system special software which
translates a programming language into machine
language and assembles the program to check errors
upon correct usage of programming language

Program Documentation
 It entails the preparation of a document describing
how the program is constructed, together with all the
significant resources surrounding its creation
 This phase is performed at every stage of the program
development such that an output of each development
stage is documented

Program Implementation and Maintenance


 It is the final stage of program development life cycle
which involves running the system and updating the
software as needed
 Program continually be modified or revised to cope
with changes and persistently be useful.
Declaring and Using Variables
and Constants

 Data items
 All the text, numbers, and other information that are
processed by a computer
 Stored in variables in memory
 Different forms
 Variables
 Literals, or unnamed constants
 Named constants

Working with Variables


 Named memory locations
 Contents can vary or differ over time
 Declaration
 Statement that provides a data type and an identifier
for a variable
 Identifier
 Variable’s name
 Data type
 Classification that describes:
 What values can be held by the item
 How the item is stored in computer memory
 What operations can be performed on the data
item
 Common Data Types:
 String
 Integer
 Float
 Boolean
 Variable initialization with value
 Declare a starting value for any variable
 Garbage
 Variable’s unknown value before initialization

Understanding the Data Types of Variables
 Numeric variable
 Holds digits
 Can perform mathematical operations on it
 String variable
 Can hold text
 Letters of the alphabet
 Special characters such as punctuation marks
 Assign data to a variable
 Only if it is the correct type
Naming Variables
 Programmer chooses reasonable and descriptive
names for variables
 Programming languages have rules for creating
identifiers
 Most languages allow letters and digits
 Some languages allow the use hyphens (-), dollar sign
($) and underscore (_)
 Some languages allow dollar signs or other special
characters
 Different limits on the length of variable names
 Camel casing
 Variable names such as hourlyWage have a “hump”
in the middle
 Variable names used throughout:
 Must be one word
 Should have some appropriate meaning

Choosing Identifiers Guidelines


 Give a variable or a constant a name that is a noun
 Use meaningful and descriptive names
 Use pronounceable names
 Be cautious in your use of abbreviations

Assigning Values to Variables


 Assignment statement
 myAnswer = myNumber * 2
 Assignment operator
 Equal sign (=)
 Always operates from right to left
 Valid
 someNumber = 2
 someNumber = someOtherNumber
 Not valid
 2 + 4 = someNumber

Performing Arithmetic Operations


 Standard arithmetic operators:
 + (plus sign) - addition
 − (minus sign) - subtraction
 * (asterisk) - multiplication
 / (slash) – division
 % (percent sign) - modulus

Understanding Constants and Literals


 Constants is a data type that refer to fixed values that
the program may not alter and they are called literals.
 Constants are treated just like regular variables except
that their values cannot be modified after their
definition.
A Literal is notation for representing a fixed value of the data
type constant. A literal is not a name, it is the value itself. 
Answer the Questions:
B. DEVELOPMENTA
L ACTIVITIES 1. Computer programs also are known as .
a. hardware
b. software
c. data
d. information

2. The major computer operations include .


a. hardware and software
b. input, processing, and output
c. sequence and looping
d. spreadsheets, word processing, and data communications

3. Which of the following is temporary, internal storage?


a. CPU
b. hard disk
c. keyboard
d. memory

C. CLOSURE Summary
ACTIVTIES
 Together, computer hardware (physical devices) and software
(instructions) accomplish three major operations: input,
processing, and output. You write computer instructions in a
computer programming language that requires specific syntax;
the instructions are translated into machine language by a
compiler or interpreter. When both the syntax and logic of a
program are correct, you can run, or execute, the program to
produce the desired results.
 For a program to work properly, you must develop correct
logic. Logical errors are much more difficult to locate than
syntax errors.
 A programmer’s job involves understanding the problem,
planning the logic, coding the program, translating the
program into machine language, testing the program, putting
the program into production, and maintaining it.

Check for Understanding

1. In your own words, describe the steps to writing a computer


program.
IV. SYNTHESIS / A computer system is a combination of all the components required to
GENERALIZATION process and store data using a computer.
Hardware is the collection of physical devices that comprise a
computer system.

Software consists of the programs that tell the computer what to do.
Programs are sets of instructions for a computer.

Programming is the act of developing and writing programs.

Application software comprises all the programs you apply to a task.

An app is a piece of application software; the term is frequently used


for applications on mobile devices.

System software comprises the programs that you use to manage your
computer.

Input describes the entry of data items into computer memory using
hardware devices such as keyboards and mice.
V. EVALUATION Chapter Quiz

Explain how data can be stored in a storage device.


VI. ASSIGNMENT / Research about:
AGREEMENT a. Flowchart and Pseudocode
b. Flowcharting Symbols and Functions
c. Basic Control Structure of Flowchart
REFERENCES Programming Logic and Design Comprehensive
by Joyce Farrel

Das könnte Ihnen auch gefallen