Programming 01 PRELIMINARIES REVIEWER
Programming 01 PRELIMINARIES REVIEWER
GENERATIONS OF PROGRAMMING
LANGUAGE
1ST GENERATION “MACHINE LANGUAGE”
6 STAGES OF IN DEVELOPING - uses binary codes that consist of string of
COMPUTER PROGRAMMING only zeroes and ones
Defining the problem - these are languages that a computer can
Designing a solution to the program understand and execute directly
Writing the program - machine dependent
Compiling, debugging, and testing the - low-level language
program 2ND GENERATION “ASSEMBLY LANGUAGE”
Documenting the research program - uses mnemonics or very short words for
Maintaining the program commands
WHY DO WE PROGRAM? - program written in assembly language must
To make life easier be converted by an ASSEMBLER
Let’s take election for example. Back in - low-level language
the day, it takes days to determine a victor in - TASM, MASM
government elections. So, they posed a solution 3RD GENERATION “HIGH-LEVEL LANGUAGE”
in which they would automate the elections for a - more or less independent of a particular type
hassle free process. Now, it approximately takes of computer
only one day to determine newly elected officials. - closer to human languages and they are
TYPES OF PROGRAMMING ERRORS easier to read, write, and maintain
- uses a COMPILER to translate the source
SYNTAX ERRORS
code into machine readable code
errors due to the fact that the syntax of the
- FORTRAN, BASIC, COBOL, PASCAL, C, C++,
language is not respected
ALGOL, ADA, JAVA
SEMANTIC ERROR
4TH GENERATION “OBJECT-ORIENTED
errors due to the improper use of program
PROGRAMMING LANGUAGE”
statements
- organize coding around objects
LOGICAL ERROR
- event-driven event triggers the the outcome
errors that occur when the specification is not
of the program
respected
- JAVA, C+, C#, Visual Basic, VB.NET
COMPILE TIME ERRORS
5TH GENERATION “LOGIC PROGRAMMING”
errors that occur during the compilation phase - artificial language
before the program is run; typically caused by - operates on concept of solving problems
incorrect syntax or type-related errors based on constraints or rules that have been
RUNTIME ERRORS declared in the program
errors occur during the execution of the - the focus is on making the computer
program, often due to unexpected conditions program solve the problem for you
like dividing by zero or accessing invalid - uses knowledge bases and expert system
memory - PROLOG, MERCURY, LISP
WHAT IS PROGRAMMING
well
LANGUAGE?
E -04
Artificial language used to communicate IT
ew
-
11
b e r to
m
Reme k s !
r e a VARIABLES
take b
value that can be changed depending on
conditions or on information passed to the
program
can be reused throughout the program,
instead of having to type out the actual value
all over and over again
VARIABLE DECLARATION
In Java Programming, you can define a
variable with the following format:
Data Type Variable Name = Value
String User_Name = “Juan Dela Cruz”
Always remember that Java is case IDENTIFIERS
sensitive programming language similar to IDENTIFIERS - names given to various
C languages program elements such as variables,
functions, and arrays
RULES IN USING VARIABLES The following are the guidelines in creating
A VARIABLE CAN: identifiers in Java
Any unicode character that is a letter 1. Consists of letters and digits without space,
(including numeric letters like Roman in any other, except that the first character
numerals) or a digit must be a letter.
Currency sign (such as $) 2. Uppercase and lowercase are permitted but
Connecting punctuation character (such as _) they are not interchangeable. As an
A VARIABLE CANNOT: exception, an underscore may be used as the
Variable names are CASE-SENSITIVE. first character of the identifier.
A variable’s name can be any legal identifier. 3. Reserved words and standard methods must
It can contain unicode letter, digits, and two not be used.
special characters such as underscore and $ Example of Valid Identifiers:
dollar sign.
Length of Variable name can be any number. Salary_Per_Month _area_circle passing_grade75
RELATIONAL OPERATORS
LOGICAL OPERATORS
BITWISE OPERATORS
shift the bit value; first (left) operand
represents the value to undergo the shift,
while the second (right) operand defines the
number of positions to shift the buts in the
value
significance of both operands is equal
ASSIGNMENT OPERATORS
made it!
You