Keep scrolling down for answers and more stats ...
Nature of Programming Languages
Basic abilities of computer: Add, Compare, Retrieve, Store
Combinations of above. Example: Finding maximum of four numbers
Meaning of code/construction of programming language
"Grammar"/Rules of statement construction in programming language
Commands/Words with special meanings. Examples: import, int, static
Only language understood directly by computer, made of 1s and 0s => hard to write, debug, and maintain.
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.
Translates above to machine code
Uses elements of natural language => easy to use, facilitates abstraction; program development is simpler, faster, and more understandable
Translates entire source program to object program only once, returning syntax errors if any. Examples: Java, C++
Unlike above, reads and translates one line of source program at a time. Examples: BASIC, Python
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;
Like above but cannot be modified during execution. Example: final double PI = 3.14159;
Performs calculations i.e. "+", "-", "*", "/", "%"
Has data and actions/methods.
"=" / "=="
"≠" / "!="
Not equal to
Greater than or equal to
Less than or equal to
"/" / "div"
Integer part of quotient
"%" / "mod"
Visibility of variable, i.e. specific part(s) of algorithm, such as a loop, that can access and retrieve data of variable.
Variable that is visible to entire program
Unlike above, has limited scope
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
Allows programmers to save time by taking advantage of existing code developed either by themselves or other programmers.
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.
Simply performs task or executes commands
May (get) or may not (void) return value
Small section of program customized by programmer to perform a particular task.
Information used in method, function, or procedure