Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Comp 212 Assignment 2

Uploaded by

mendz.trust
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Comp 212 Assignment 2

Uploaded by

mendz.trust
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

EASTERN VISAYAS STATE UNIVERSITY

ORMOC CAMPUS
Brgy. Don Felipe Larrazabal, Ormoc City, Philippines

Assignment #2

(Comp 212 – Computer Fundamentals and Programming)

In Partial Fulfillment of the


Requirements for the Degree of
BACHELOR OF SCIENCE IN MECHANICAL ENGINEERING

Gian Ross Anthony M. Mendoza


Student’s name

Loila S. Empimo
Instructor’s name
1. What is Computer programming?

Computer programming is the act of creating and writing instructions that a


computer may follow to do certain tasks or solve issues. This entails writing
code in a variety of programming languages, such as Python, Java, or C+
+, that instructs the computer how to process data, run algorithms, and
interface with other software or hardware.

Effective programming necessitates not just a solid understanding of logic


and problem solving, but also familiarity with the syntax and semantics of
the programming language of choice.

2. What are the three types of program translator?

There are three sorts of program translators: compilers, interpreters, and


assemblers. A compiler converts a program's whole source code into
machine code prior to execution, producing a standalone executable file.
An interpreter interprets and executes source code line by line, resulting in
instantaneous execution but often slower performance. An assembler
transforms assembly language code to machine code, generating an
executable file from low-level instructions unique to a given computer
architecture.

3. Advantages and Disadvantages of Translators.

Compilers:

Advantages
 Efficiency: Description Generates optimized machine code, resulting
in quicker execution times.
 Error Checking: Extensive error checking is performed during
compilation to reduce runtime errors.
 Stand-Alone Executables: Creates standalone executable files that
do not require the compiler to be present during execution.

Disadvantages
 Compilation Time: It takes time to compile the complete code before
execution, which might be sluggish for big programs.
 Complex Debugging: Debugging can be more difficult since mistakes
are detected after the complete program has been built.
Interpreters:

Advantages
 Immediate Execution: Executes code line by line, which is beneficial
for development and testing because changes can be tested fast.
 Ease of Debugging: Errors are captured at runtime, which provides
instant feedback and makes debugging easier.

Disadvantages
 Performance: Translation takes place on-the-fly, hence execution is
often slower than with compiled code.
 Dependency: The interpreter must be installed on the system where
the code runs.

Assemblers:

Advantages
 Direct Hardware Control: Enables precise control over hardware
resources as well as efficient system resource use.
 Optimized Code: Creates machine code that is highly optimized for
specific hardware.

Disadvantages
 Complexity: Assembly language is low-level, which can be more
complex and harder to learn and use than high-level languages.
 Portability: Machine code is frequently specialized to a single
processor architecture, making it less transferable across computers.

You might also like