Definition
|
Term
|
Nature of Programming Languages
|
Basic abilities of computer: Add, Compare, Retrieve, Store
|
Fundamental operations
|
Combinations of above. Example: Finding maximum of four numbers
|
Compound operations
|
Meaning of code/construction of programming language
|
Semantics
|
"Grammar"/Rules of statement construction in programming language
|
Syntax
|
Commands/Words with special meanings. Examples: import, int, static
|
Keywords
|
Only language understood directly by computer, made of 1s and 0s => hard to write, debug, and maintain.
|
Machine language
|
Unlike above, allows development of instructions and reference to address locations with mnemonics; program development is easier but each language supports only one specific computer system.
|
Assembly language
|
Translates above to machine code
|
Assembler
|
Uses elements of natural language => easy to use, facilitates abstraction; program development is simpler, faster, and more understandable
|
High-level language
|
Translates entire source program to object program only once, returning syntax errors if any. Examples: Java, C++
|
Compiler
|
Unlike above, reads and translates one line of source program at a time. Examples: BASIC, Python
|
Interpreter
|
Handles code function on hardware platform.
|
Java Virtual Machine (JVM)
|
.class file compiled from Java source code. Fed into interpreter afterwards.
|
Java Virtual Machine bytecode
|
Use of Programming Languages
|
Stores data element, which can be changed during execution, of program. Has name and type i.e. int age;
|
Variable
|
Like above but cannot be modified during execution. Example: final double PI = 3.14159;
|
Constant
|
Performs calculations i.e. "+", "-", "*", "/", "%"
|
Operator
|
Has data and actions/methods.
|
Object
|
"=" / "=="
|
Equal to
|
"≠" / "!="
|
Not equal to
|
">"
|
Greater than
|
">="
|
Greater than or equal to
|
"<"
|
Less than
|
"<="
|
Less than or equal to
|
"/" / "div"
|
Integer part of quotient
|
"%" / "mod"
|
Remainder
|
Visibility of variable, i.e. specific part(s) of algorithm, such as a loop, that can access and retrieve data of variable.
|
Scope
|
Variable that is visible to entire program
|
Global variable
|
Unlike above, has limited scope
|
Local variable
|
Consists of multiple elements - which may be duplicate - such as objects and values, and comes with necessary operations/methods, such as add and remove, that programmer can immediately use to manipulate data. Example: ArrayList
|
Collection
|
Allows programmers to save time by taking advantage of existing code developed either by themselves or other programmers.
|
Code reuse
|
Contains sequence of instructions that perform specific and predefined task. More than one of this may be contained in software libraries that can be used by programs. Three examples below.
|
Sub-program
|
Simply performs task or executes commands
|
Procedure
|
May (get) or may not (void) return value
|
Method
|
Small section of program customized by programmer to perform a particular task.
|
Module
|
Information used in method, function, or procedure
|
Parameter
|
Passed into method, function, or procedure
|
Argument
|