Computer Fundamentals & Programming Module
Computer Fundamentals & Programming Module
APPROVAL SHEET
PANEL OF EVALUATORS
Recommending Approval:
Approved:
OMSC VISION
A premier higher education institution that develops globally competitive, locally responsive, innovative professionals and life-long learners.
OMSC MISSION
OMSC is committed to produce intellectual and human capital by developing excellent graduates through outcomes-based instruction, relevant research, responsive technical
advisory services, community engagement, and sustainable production.
COLLEGE OF ARCHITECTURE, ENGINEERING AND TECHNOLOGY GOAL
To provide advance knowledge in Architecture, Engineering & Technology, technical skills, and appropriate work ethics among the students with the aim of improving the quality of
life in the province of Occidental Mindoro, and be of help to boost the economic stability of the country and the ASEAN region.
i
The Bachelor of Science in Civil Engineering aims to produce competent civil engineers capable of embracing services such as consultancy, design, preparation of plans and
specifications, construction and supervision of projects in government or private sector projects.
The Bachelor of Science in Electrical Engineering shall provide the students with an education in the fundamentals of Electrical Engineering that will allow them to be immediately
competitive in the industry or in graduate work while providing the best opportunity for achieving full potential. Develop a sense of professional responsibility and social awareness.
Provide practical applications and hand-on work as evidence by laboratory, design, project study, computer exercises and practicum courses. These would help the student to work
well whether independently or as part of a group.
The Bachelor of Science in Industrial Engineering is intended the student for a professional Industrial Engineering career including a leading role in design, improvement and
installation of integrated system of people, materials, information, equipment and energy. Graduates of the program must have specialized knowledge and skills in the mathematical,
physical and social science together with the principle methods of engineering analysis and design to specify, predict, and evaluate the result to be obtained from such system.
PROGRAM OUTCOMES:
BSCE
Apply knowledge of mathematics and science to solve complex civil engineering problems.
Know and understand engineering and management principles as a member and leader of a team, and to manage projects in a multidisciplinary environment.
BSEE
Ability to apply techniques, skills, and modern engineering tools necessary for electrical engineering practice.
BSIE
Ability to apply knowledge of mathematics and science to solve complex industrial engineering problems
Ability to use techniques, skills, and modern engineering tools necessary for engineering practice
COURSE OUTCOMES:
After completing this course, the student must be able to:
COURSE OUTLINE
Orientation of the students on the updates on the VMGO and Core Values of the Institution ( 1hour)
Orientation of the Students on the importance of gender equality and increase their awareness on the new accepted genders in society ( 1 hour)
Desired Learning Course Content Textbooks/References Teaching / Learning
Week Resource Materials Assessment
Outcomes Activities
ii
Recognize what is a LESSON 1. Gaddis, T. ONLINE Laptop Quiz #1:
program and its use. Introduction to Computers (2011). Starting Out Video Lecturing Internet Programming
Identify the Computer and Programming with C++: From Video Connection languages
systems. Why Program? Control Structure to Demonstration Quiz #2: What
Distinguish the different Computer Systems: Objects. Addison- is a program
programs and Hardware and Wesley Publishing MODULE made of?
programming Software Company. Module Lectures
languages. Programs and Task 1: Reaction
1-2 Programming
Identify the Paper about the
programming process Languages video to be send
and its flow. What Is a Program online.
Made of?
Input, Processing,
and Output
The Programming
Process
Identify what is Binary LESSON 2. Number Harle, R. (2015). ONLINE Laptop Quiz #3:
Numbers. System and Data Computer Video Demonstration Internet Conversion of
Predict how to add Representation Fundamentals. Video Lecturing Connection Binary numbers
binary numbers. Binary Numbers Number System. 2- Quiz #4:
Laboratory Activity:
Identify how to convert Converting Binary 47 Adding,
to Decimal #1. Hexadecimal to
binary to decimal Subtracting,
numbers and vice versa. Numbers and vice Color Multiplying and
versa Dividing Binary
3-4 Adding, MODULE Numbers
Subtracting, Module Lectures Laboratory
Multiplying and Task 2: Conversion Activity thru
Dividing Binary Binary to Photoshop web
Numbers Hexadecimal app
Hexadecimal ([Link]
System [Link]/
) to be uploaded
iii
to
[Link]
iv
Learn how to assigned Combined Laboratory Activity:
multiple and combined Assignment #5. Arithmetic
assignment. Working with Operators
Identify the characters Characters and
and string objects. string objects MODULE
Module Lectures
Task 6: Predict the
output
Task 7: Debugging a
program
MIDTERM EXAMINATION
Distinguish the relational LESSON 5. Making Gaddis, T. ONLINE Laptop Quiz #7: If and
operators. Decisions (2011). Starting Out Video Demonstration Internet if else statement
Identify how to use if, if Relational with C++: From Video Lecturing Connection Quiz #8:
else, if else if, and Operators Control Structure to Predicting the
Laboratory Activity:
nested if statements. The if statement Objects. Addison- Ouptut
The if/else Wesley Publishing #6. If statement
Recognize the logical Quiz #9: Logical
operators. statement Company. Laboratory Activity: operators and
Familiarize with the use Nested if #7. If/else statement switch
of switch statement. statements Laboratory Activity: statement
The if/else if #8. if else if Laboratory
9-10 statement activity using
statement
The Logical Dev C++
Operators Laboratory Activity:
The Switch #9. Switch statement
statement
MODULE
Module Lectures
Task 8: Relational
Operators
Task 9: Debug a
program
v
Task 10: Create a
program using if
statement
Task 11: Predict
the output of switch
statement
Identify the increment LESSON 6. Loops Gaddis, T. ONLINE Laptop Quiz #10: While
and decrement The Increment and (2011). Starting Video Demonstration Internet and Do while
operators. Decrement Out with C++: From Video Lecturing Connection loop
Recognize the while Operators Control Structure to Quiz #11: For
Laboratory Activity:
loop and for input The While loop Objects. Addison- loop and Nested
Using while loop for #10. While Loop
validation. Wesley Publishing loops
Determine the use of do input validation Company. Laboratory Activity: Laboratory
while loop and its The do-while loop #11. Do while loop activity using
difference to while loop. The for loop Laboratory Activity: Dev C++
Familiarize with for loop. #12. For loop
11-12 MODULE
Module Lectures
Task 12: Predicting
the Output
Task 13: Debug a
program
Task 14: Create a
program using
while loop
Task 15: Create a
program using do
while loop
vi
Task 16: Predicting
the output of for
loop
Recognize array and LESSON 7. Arrays Gaddis, T. ONLINE Laptop Quiz #12:
how it holds a value Arrays Hold (2011). Starting Out Video Demonstration Internet Arrays
Identify array elements Multiple Values with C++: From Video Lecturing Connection Laboratory
and its initialization Accessing Array Control Structure to activity using
Laboratory Activity
Distinguish the two- Elements Objects. Addison- Dev C++
Array Initialization Wesley Publishing #13: One-
13-14 dimensional array and
its difference to one Two-Dimensional Company. dimensional Array
dimensional. Arrays
Identify arrays with Arrays with Three MODULE
three or more or More Task 17: Predicting
dimensions Dimensions the Output
FINAL EXAMINATION
SUGGESTED LEARNING RESOURCES
Harle, R. (2015). Computer Fundamentals. Number System.
Gaddis, T. (2011). Starting Out with C++: From Control Structure to Objects. Addison-Wesley Publishing Company
Other Readings/References:
a. Online References
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
Group/Individual projects
Group/Individual reports/Assignments
COURSE REQUIREMENTS Complete submission of final outputs
Written examinations
vii
Learning Activities = 40%
Mid-term ∕ Final Examination = 60%
GRADING SYSTEM
100%
Final Rating = Mid -Term (40%) + Final Term (60%)
Attendance:
1. Students having twelve (12) absences without valid reasons will be dropped from the class. Students are required to
present admit to class slip from the Office of Student Affairs and Services after being absent in the previous meeting.
2. Three (3), not necessarily consecutive, tardiness without further notice is equivalent to one (1) absence.
COURSE POLICIES
Incomplete Grade:
1. Students who were not able to take the midterm/final examinations will receive an incomplete grade.
2. Incomplete grade should be complied within one year.
________________________ ________________________
Date Date
viii
ENGR. CHARMINE SHEENA S. SAFLOR, MSIE
Program Head, BS Industrial Engineering
Recommending Approval:
________________________
Date
ix
PREFACE
This learning module is divided into seven lessons introduces the basic
information technology concepts; fundamentals of algorithm development; high-level
language and programming applications; computer solutions of engineering problems.
C++ (pronounced see plus plus) is a general purpose programming language that is free-
form and compiled. It is regarded as an intermediate-level language, as it comprises both
high-level and low-level language features. It provides imperative, oriented and generic
programming features.
This module can also be used as course material for introduction to fundamentals
computer and programming in other colleges. There is no doubt that this module will be
useful to all categories of readers. In case of any suggestion for improvement of this
module you may email charmainedeguzman15@[Link].
TOPICS
LEARNING OUTCOMES
IDEA: The binary number system, also called the base-2 number system, is a
method of representing numbers that counts by using combinations of
only two numerals: zero (0) and one (1).
A bit (Binary digit) is merely 0 or 1
It is a unit of information since you cannot communicate with anything less than
two states
The use of binary encoding dates back to the 1600s with Jacquard's loom, which
created textiles using card templates with holes that allowed needles through
Digital computers are made up of electronic circuits, which have exactly 2 states: on
and off.
19
A binary digit or bit can take on only these two values.
Low Voltage = 0
High Voltage = 1 all bits have 0 or 1
Each digit in a binary number if called a BIT, 4 bits form a NIBBLE, 8 bits form a
BYTE, 2 bytes form a WORD, 2 words form a DOUBLE WORD.
Based two
20
It is often required to convert a number in a particular number system to any other
number system, e.g., it may be required to convert a decimal number to binary. The
reverse is also true, i.e., a binary number may be converted into decimal and so on.
In converting binary number, all you have to remember that 0-represents a false
condition and 1- represents true. Meaning all you have to take is the true condition which
is 1. Don’t forget to start to count from the lowest bit which is in the right.
All you have to do is to add all the binary which is in true condition. Now let’s try with
a combination of 0.
21
Now to convert a number in decimal to a number in binary we have to do the same
method just like converting binary to decimal. But this time you have to start with the
largest bit near to the decimal number you want to convert.
This time we started at the largest bit which is 16. Our decimal value to convert is
23, we cannot go far aside from 16 because the next one will be 32 bit value which is more
than 23.
NOTE: Get first the largest bit which is near but not more than to your decimal
number, and then start to add another bit until reached the equal
number.
In here we started at the largest bit which is 32 (near but not more that to 34) and
then we start adding another bit to get exact value which is 34.
22
ASSESSMENT
Assessing your knowledge of converting the binary to decimal and vice versa.
23
Adding, Subtracting, Multiplying and Dividing Binary
2.3 Numbers
IDEA: Binary arithmetic is essential part of all the digital computers and
many other digital system.
In Binary numbers were introduced, as well as the techniques of their addition and
subtraction. This package covers the methods of multiplication and division but to begin,
here is a reminder of the rules of binary addition and subtraction.
ADDITION
Checking:
24
SUBTRACTION
Checking:
25
Working with borrow:
26
MULTIPLICATON
The multiplication process for binary numbers is similar to decimal numbers. Partial
products are formed, with each product shifted one place to the left.
Checking:
DIVISION
Binary division follows a similar process to that of decimal division.
27
The given is 1010 divided to 101 the answer is 10.
Steps:
1. Get first dividend the same number of bit to
divisor. Example the divisor is 101, you must get 3 bits in
dividend which is 101.
2. Follow the rules, the dividend is equal to divisor
(101 = 101) so the answer is 1. To be place also at the top
in line with the second lowest bit.
3. Multiply the quotient to the divisor and then subtract.
4. Now you have the reduced dividend which is 0000. The reduced
dividend is lesser than the divisor so the answer is 0.
To divide binary numbers, start by setting up the binary division problem in long division
format. Next, compare the divisor to the first digit of the dividend. Tack on the next digit
and repeat until you get a 1, then find the remainder.
28
ASSESSMENT
I – ADDITION
5.) 101101
+ 110010
II – SUBTRACTION
10.) 1100000
- 101010
III – MULTIPLICATION
29
IV – DIVISION
Hexadecimal number system uses base 16. The digits in this system range 0 to 15.
By conversion, letters A through F is used to represent the hexadecimal digits
corresponding to decimal values 10 through 15.
30
DECIMAL BINARY HEXADECIMAL
0 0 0
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Example:
Binary strings which cannot be exactly divided into a whole number of 4-bit groups are
assumed to have 0’s appended in the most significant bits to complete a group.
31
How to convert Hexadecimal number to Binary number?
Converting from Hexadecimal back to binary is also very simple. Each digit of the
Hexadecimal number is replaced by an equivalent binary string of 4-bits.
F D 1 3 Hexadecimal Number
1111 1101 0001 0011 Replacing each Hexadecimal digit by its 4-bit binary
equivalent
ASSESSMENT
32
LABORATORY ACTIVITY
Name: _________________________________________ Date: ___________________
Course/Year/Section: _____________________________ Score: __________________
ACTIVITY No. 1
Hexadecimal to Color
Instruction: Convert the following binary numbers to find the corresponding color of each
in your Adobe Photoshop.
Example: 1101 0001 0010 1010 1100 0011 = VIOLET
33