DCIT22-Computer Programming 1 - Learning Module 2
DCIT22-Computer Programming 1 - Learning Module 2
Silang Campus
CvSU Mission
Campus Goals
Learning Objectives:
Show different programming language;
Identify the program development cycle;
Analyze the uses of concepts, variables and data types.
They say that a computer is a useful tool for solving many problems, but the computer relies
on human to give instructions for them to complete specific task.Those instructions are
called programs and the person who creates the program is called programmer.
So when the computer receives an instruction the computer reads it as 1 and 0 because the
computer can only understand on and off switches represented as 1’s and 0’s because it is
powered by electricity. These 1’s and 0’s are also known as machine-level language or low-
level language. The assembly language was developed which simplifies the big task of
series of writing of 1’s and 0’s through alphabetic abbreviations called mnemonic code.
Programming Language
These languages allow computers to quickly and efficiently process large and complex
information.There are dozens of Programming Language(PL) used in industry today
For Example:C,C++,C#,VB.net, etc. These are the examples of a compiler that can
translate the instruction from high-level language which human can understand to
machine-level language that the computer can understands.
This is a comment line. All lines beginning with two slash signs (//) are considered comments
and do not have any effect on the behavior of the program. The programmer can use them
to include short explanations or observations within the source code itself.
In this case the directive #include <iostream> tells the preprocessor to include the
iostream standard file.This specific file (iostream)
includes the declarations of the basic standard input-output library in C++, and it is
included because its functionality is going to be used later in the program.
The main function is the point by where all C++ programs start their execution,
independently of its location within the source code. It does not matter whether there
are other functions with other names defined before or after it.
“cout” represents the standard output stream in C++, and the meaning of the entire
statement is to insert a sequence of characters (in this case the Hello World
sequence of characters) into the standard output stream (which usually is the
screen).
The return statement causes the main function to finish. return may be followed by a return
code (in our example is followed by the return code 0). A return code of 0 for the main
function is generally interpreted as the program worked as expected without any errors
during its execution.
RESERVED WORDS
IDENTIFIER
Identifiers are names that appear in programs. Some of its examples are variables,
constants and functions. Some identifiers are predefined (Example: cout, cin). Some are
defined by the users.
WHITESPACES
White spaces are the blanks, tabs and new lines. It is used to separate special
symbols,reserved words and identifiers. They make programs more readable.