Fundamentals of Programming
Fundamentals of Programming
programming
Metalanguage
Programming Languages are languages that people use that are similar to
human language, which will be translated into machine code for the computer
to understand.
2
Metalanguage
A Token is the smallest individual unit of a program.
3
Metalanguage
Data types specify the different sizes and values that can be stored in the
variable.
Primitive type variables directly store data into their memory space.
Reference variables store the address of the object containing the data.
4
Evolution of Programming
Languages
• Machine languages
• Assembly languages
• Higher-level languages
5
Machine languages
• These are the first-generation languages that are the most basic
type of computer languages, consisting of strings of numbers the
computer’s hardware can use.
6
Assembly languages
• These are second-generation languages, developers use cryptic
English-like phrases to represent strings of numbers.
7
Higher-level languages
• Higher-level languages are more powerful than assembly
language and allow the programmer to work in a more English-
like environment.
• Higher-level programming languages are divided into three
“generations”, each more powerful than the previous:
• Third-generation languages (eg. FORTRAN, COBOL, C, C++, BASIC)
• Fourth-generation languages (eg. SOL, CSS, Coldfusion)
• Fifth-generation languages (eg. Mercury, Prolog, OPS5)
8
Java Program
Java instructions need to be translated into an intermediate
language called bytecode.
9
10
11
Programming
Methodologies
Programming Methodologies
Algorithm: a step-by-step problem-solving
process in which a solution is arrived at in a finite
amount of time
13
14
Programming design
Structured Object - Oriented
o A problem is divided into o In OOD, a program is a
smaller subproblems collection of interacting objects
15
Flowchart
16
17
Start
Int num;
int r;
r = num % 2
Yes Is r = No
Odd Even
1?
End
18