Republic of the Philippines
EASTERN VISAYAS STATE UNIVERSITY
ORMOC CAMPUS
Ormoc City, Leyte
ASSIGNMENT 2
(Comp 212 – Computer Fundamentals and Programming)
Instructions: Briefly discuss your answer. (Total: 25 points)
1. What is Computer Programming? (5 points)
2. What are the three types of Program Translator? (5 points)
3. Advantages and Disadvantages of Translators. (15 points)
Prepared by:
LOILA S. EMPIMO
Faculty
1. Computer programming means the writing, testing, and maintenance of the code,
which enables the computer software and hardware to execute a certain task. It is all
about writing instructions, now called 'code,' that the computer will follow in order
to perform specific actions or solve specific problems. Programmers do this through
writing code in many different programming languages, including Python, Java, and
JavaScript, depending on what the application requires. There are high-level
languages, which man's intellect can grasp more effectively; there are low-level
languages as well, which are closer to the machine code, hence more complicated.
Developing algorithms is perhaps the most important activity when it comes to
programming, as they represent some sort of steps involved in order to solve any
given problem efficiently.
2. Compiler, Interpreter, Assembler. A compiler is a translator that converts the entire
source code written in a high-level programming language (like C or Java) into
machine code (binary code) before execution. The resulting machine code can be
executed directly by the computer's hardware. Compilers translate the entire
program in one go and report errors after the compilation process. Once compiled,
the program can be run repeatedly without needing to be recompiled. An interpreter
translates high-level programming code into machine code line-by-line, executing
each line immediately after translating it. This means the program doesn't need to
be fully compiled before running. Interpreters are commonly used in scripting
languages like Python or JavaScript. An assembler is a translator that converts
assembly language code (a low-level, human-readable form of machine language)
into machine code. Assembly language is closely related to machine language, but
it uses symbolic names (mnemonics) for operations, making it easier for humans to
read and write.
3. Advantages - Faster execution since the code is already in machine language. It
allows for optimization of the code during the compilation. Easier to debug because
errors are shown as they occur during execution. Useful for rapid prototyping and
development. Assembly language provides precise control over hardware, making it
suitable for performance-critical applications.
Disadvantages - Compilation must be done before running the program, and
debugging can be more challenging since errors are reported after the whole
program is compiled. Slower execution compared to compiled programs since the
translation occurs at runtime. The program must be re-interpreted every time it's
run. Programming in assembly is more complex and time-consuming due to its low-
level nature.