Programming Answers
1. Definitions
i. Computer Program – A set of instructions that tells a computer what to do.
ii. Programming – The process of writing, testing, and maintaining computer programs.
iii. Programming Language – A formal language used to write computer programs.
iv. Program Portability – The ability of a program to run on different computer systems with
little or no modification.
v. Algorithm – A step-by-step procedure for solving a problem.
vi. Pseudocode – An informal way of writing an algorithm using plain language and
programming-like statements.
2. Low-level Languages
(a) Low-level languages are programming languages that are close to machine language and
hardware.
Features:
- Machine dependent
- Difficult to understand and write
- Fast execution
- Require little memory
(b) Advantages:
- Execute very fast
- Efficient use of memory
Disadvantages:
- Difficult to learn and debug
- Not portable between different computers
(c) Types:
- Machine language
- Assembly language
3. Difference Between Machine Language and Assembly Language
Machine Language: Uses binary digits (0s and 1s); directly understood by the CPU.
Assembly Language: Uses mnemonics such as ADD, MOV; requires an assembler.
4. High-level Languages
(a) Programming languages that use English-like statements and are easier for humans to
understand.
(b) Features:
- Easy to read and write
- Machine independent
- Require translators
(c) Advantages:
- Easier to learn and use
- Easier to debug and maintain
- Portable across different computers
5. Considerations in Assembly Language
- Memory address management
- Use of processor registers
- Hardware-specific instructions
6. Fourth Generation Languages (4GLs)
(a) Features:
- Non-procedural
- English-like commands
(b) Advantages:
- Faster development
- Easier to learn
- Fewer coding errors
- Increased productivity
(c) Examples:
- SQL
- Oracle Forms
- FoxPro
7. Main Feature of Fifth Generation Languages
- Based on Artificial Intelligence (AI) and logical problem solving.
8. Object-Oriented Programming (OOP)
(a) A programming approach that organizes programs into objects containing data and
methods.
(b) Examples:
Third Generation Languages:
- FORTRAN
- COBOL
Object-Oriented Languages:
- Java
- C++
(c) Advantage:
- Promotes code reusability.
9. Syntax and Semantics
Syntax – Rules governing how program statements are written.
Semantics – Meaning of program statements.
10. Factors When Choosing a Programming Language
- Ease of learning and use
- Portability
- Speed of execution
- Availability of translators and tools
- Nature of the application
11. Differences
(a) Source Program vs Object Code
Source Program: Written by programmer; human-readable.
Object Code: Produced after translation; machine-readable.
(b) Flowchart vs Pseudocode
Flowchart: Uses symbols and diagrams.
Pseudocode: Uses written statements.
12. Abbreviations
FORTRAN – Formula Translation
COBOL – Common Business-Oriented Language
OOP – Object-Oriented Programming
13. Language Translators
(a) A system program that converts source code into machine code.
(b)
Assembler – Converts assembly language into machine language.
Compiler – Translates the entire high-level program into machine code at once.
Interpreter – Translates and executes a program one statement at a time.