programming language

Cards (40)

  • Programming language
    • a medium through which programmer may give instructions to a computer
  • What are the two ways of translating high-level language program code to machine-language instructions?
    Interpretation and compilation.
  • What is programming?
    • Implementing a representation of the solution for the computer to execute.
    • Encoding an algorithm using a programming language.
    • Involves sequential processing, decision-making, and iteration.
  • What must a programming language support to implement algorithms?
    Control-constructs and data-types.
  • What is machine-language?
    A language specific to the type of computer processor, consisting of binary instructions.
  • Why is it error-prone to code directly in machine-language?
    Because it consists of '0' and '1' binary format, which is difficult for humans to manage.
  • What is the purpose of high-level programming languages?
    To provide abstraction from the internal operating details of the computer.
  • What are examples of high-level programming languages?
    C, Java, Python.
  • What are the two approaches for program translation?
    1. Interpretation
    2. Compilation
  • How does the interpretation approach work?
    It uses an interpreter that reads and translates one high-level code statement at a time.
  • Name three programming languages that use the interpretation approach.
    Python, R, and JavaScript.
  • How does the compilation approach work?
    It uses a compiler to read and translate the entire high-level language program into machine-language instructions.
  • What are examples of programming languages that use the compilation approach?
    C and C++
  • What is unique about Java's translation technique?
    Java uses a combination of both interpretation and compilation techniques.
  • Compare the advantages and disadvantages of interpreters and compilers.
    Interpreter:
    • Portable across different platforms.
    • Produces results almost immediately.
    • Easy to debug.
    • Executes more slowly.

    Compiler:
    • Runs very fast after compilation.
    • Smaller code size after compilation.
    • Must compile the entire program before execution.
    • Needs recompilation for different platforms.
  • What was C language originally developed for?
    To help implement the Unix operating system.
  • What is a key feature of C language?
    It allows for direct access and manipulation of the underlying computer's hardware.
  • What are some applications suitable for C language?
    Embedded systems development, operating systems implementations, and device drivers.
  • What is C++ an extension of?
    C language.
  • What programming paradigm does C++ support?
    Object-Oriented Programming (OOP).
  • What is the focus of programming in OOP?
    On how objects interact with one another.
  • What are some applications suitable for C++ language?
    Video games, GUI-based applications, and operating systems design.
  • What is Python known for?
    Being a relatively easy-to-learn programming language.
  • What type of applications is Python targeted for?
    General purpose programming for applications that do not need direct access to the computer's hardware.
  • How does the Python interpreter work?
    It converts and executes Python program statements one-by-one to machine instructions.
  • What are some applications suitable for Python language?
    Data science and web development.
  • What is Java known for?
    Being a highly portable, general-purpose language with Object-Oriented support.
  • How does Java achieve portability?
    By running as an interpreted language on a Java Virtual Machine (JVM).
  • What is the process of Java program execution?
    The source code is compiled to Java bytecode, which is then interpreted by the JVM.
  • What are some applications suitable for Java language?
    Mobile apps for Android phones and game development.
  • What is a webpage?
    • A text document transferred over the internet.
    • Displayed in a web browser (e.g., Chrome, Safari).
  • What language is commonly used to describe the content of a webpage?
    HTML (Hypertext Markup Language).
  • How can a webpage be made dynamic and interactive?
    By adding scripts in languages such as JavaScript.
  • What is PHP used for?
    To dynamically generate HTML webpages before they are sent to the browser.
  • What are the applications of R language?
    • Used for statistical computing and data analysis.
    • Provides extensive graphic plotting functions.
    • Useful for developing science and engineering computation applications.
  • What are the applications of MATLAB language?
    • Used primarily for numerical computing.
    • Supports functions and libraries for matrix manipulation, plotting, and data visualization.
    • Applications include audio, video, and image signal processing.
  • What are the two levels of programming languages?
    1. Low-level machine-language executed directly by the computer.
    2. High-level programming language that needs translation to machine-language for execution.
  • What are the two ways of translating programming languages?
    1. Interpreter: translates and executes statements one-by-one.
    2. Compiler: translates the entire program before execution.
  • What are examples of compiled and interpreted languages?
    • Compiled languages: C, C++.
    • Interpreted languages: Python, JavaScript, R.
    • Combination: Java.
  • What is the significance of different programming languages?
    • Each language provides different features.
    • Suitable for different requirements and applications.