Podcast
Questions and Answers
What is the primary role of a computer language?
What is the primary role of a computer language?
- To replace the need for human communication.
- To encrypt data for secure transmission.
- To translate human thoughts directly into actions.
- To serve as an interface for communication between humans and computers. (correct)
Machine language is considered machine-independent because it can be run on any computer without modification.
Machine language is considered machine-independent because it can be run on any computer without modification.
False (B)
What is the role of an assembler in the context of assembly language?
What is the role of an assembler in the context of assembly language?
An assembler translates assembly language code into machine language.
In programming, a translator that converts the entire source code into object code at once is called a ______.
In programming, a translator that converts the entire source code into object code at once is called a ______.
Match each language generation with its description:
Match each language generation with its description:
Which of the following is a characteristic of machine language?
Which of the following is a characteristic of machine language?
High-level languages are machine-dependent, meaning they can only be used on specific types of computers.
High-level languages are machine-dependent, meaning they can only be used on specific types of computers.
What is the primary advantage of using assembly language over machine language?
What is the primary advantage of using assembly language over machine language?
A program written in a high-level language is called ______ code before it is translated into machine language.
A program written in a high-level language is called ______ code before it is translated into machine language.
Match each programming language with its generation:
Match each programming language with its generation:
What distinguishes fourth-generation languages (4GLs) from third-generation languages (3GLs)?
What distinguishes fourth-generation languages (4GLs) from third-generation languages (3GLs)?
Fifth-generation languages (5GLs) are primarily used in business applications due to their simplicity and ease of use.
Fifth-generation languages (5GLs) are primarily used in business applications due to their simplicity and ease of use.
What is the main advantage of high-level languages regarding portability?
What is the main advantage of high-level languages regarding portability?
The program converted into machine language after compilation is known as ______ code.
The program converted into machine language after compilation is known as ______ code.
Match the programming paradigm with its approach:
Match the programming paradigm with its approach:
Which of the following is a key principle of Procedure-Oriented Programming (POP)?
Which of the following is a key principle of Procedure-Oriented Programming (POP)?
Object-Oriented Programming (OOP) emphasizes the operation more than the data, thus enhancing data security.
Object-Oriented Programming (OOP) emphasizes the operation more than the data, thus enhancing data security.
What are the four pillars of Object-Oriented Programming?
What are the four pillars of Object-Oriented Programming?
In Object-Oriented Programming, a blueprint for creating objects is called a ______.
In Object-Oriented Programming, a blueprint for creating objects is called a ______.
Match the characteristic with the Programming approach:
Match the characteristic with the Programming approach:
Flashcards
Computer Languages
Computer Languages
Languages that serve as an interface between humans and computers, using words, symbols, and codes.
Machine Language (1GL)
Machine Language (1GL)
A low-level language using binary digits (0s and 1s) directly understood by a computer's hardware.
Assembly Language (2GL)
Assembly Language (2GL)
A low-level language using mnemonics and op-codes, requiring an assembler to translate to machine language.
High-Level Language
High-Level Language
Signup and view all the flashcards
Third Generation Languages (3GL)
Third Generation Languages (3GL)
Signup and view all the flashcards
Fourth Generation Languages (4GL)
Fourth Generation Languages (4GL)
Signup and view all the flashcards
Fifth Generation Languages (5GL)
Fifth Generation Languages (5GL)
Signup and view all the flashcards
Source Code
Source Code
Signup and view all the flashcards
Object Code
Object Code
Signup and view all the flashcards
Compiler
Compiler
Signup and view all the flashcards
Interpreter
Interpreter
Signup and view all the flashcards
Programming Paradigm
Programming Paradigm
Signup and view all the flashcards
Procedure-Oriented Programming (POP)
Procedure-Oriented Programming (POP)
Signup and view all the flashcards
Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)
Signup and view all the flashcards
Class
Class
Signup and view all the flashcards
Instances
Instances
Signup and view all the flashcards
Data Abstraction
Data Abstraction
Signup and view all the flashcards
Inheritance
Inheritance
Signup and view all the flashcards
Polymorphism
Polymorphism
Signup and view all the flashcards
Encapsulation
Encapsulation
Signup and view all the flashcards
Study Notes
- Communication is the means to express ideas and requires a language.
- Computer language serves as an interface between humans and computers.
- It comprises words, symbols, and codes understandable by computers to write programs.
Types of Computer Languages
- Computer languages are classified into machine language, assembly language, and high-level language.
Machine Language (1GL)
- Uses binary digits (0s and 1s) grouped in sets of 8 bits (one byte).
- It directly is understood by computer hardware.
- Machine code is in binary format
- Converts all data types (text, graphics, audio) into binary format.
- Machine-dependent that does not need compilers or interpreters.
- Machine language is a first-generation language.
- Example: Character 'a' is 01100001, 'b' is 01100010
- 8 bits represent a character.
- Programs in machine language execute faster because it directly interacts with the computer.
- Code conversion is not needed if the program is written in machine language.
- Machine language is machine-dependent.
- Code in this language is in binary, which is difficult to debug.
Assembly Language (2GL)
- It is a low-level language
- Uses mnemonics (symbols and abbreviations) and op-codes (numbers).
- An "Assembler" converts it to machine language.
- MASM (Macro Assembler) is an example.
- An assembler translates assembly language code into machine language (0s and 1s).
- Uses statements instead of binary digits, so it is easily understood and developed by the programmer.
- It is easy to debug
- Needs a translator program because it's machine dependent.
- Programmers should have knowledge of mnemonics.
High-Level Language
- It overcomes the inconvenience of low-level languages
- Programs are written in English or symbols, so it is closer to human languages.
- Writing codes is easier to develop and modify.
- It needs a compiler or interpreter for execution, because it is machine-independent language.
- Third, fourth, and fifth generation languages are the three categories of high-level languages.
Third Generation Languages (3GL)
- The programmer writes English-like words to tell the computer what to do.
- Uses arithmetic operators, such as * for multiplication and + for addition.
- Examples are BASIC, PASCAL, C, FORTRAN, C++, Java, and C#.
Fourth Generation Languages (4GL)
- Uses English-like statements.
- They specify what the program should accomplish
- A 4GL is faster and takes less time to code.
- Programmers with very little programming knowledge can develop programs.
- Examples are MATLAB, Oracle Reports, or Informix.
Fifth Generation Languages (5GL)
- Natural languages are is known as the programming languages
- It has visual tools to develop a program.
- Examples include Mercury, OPS5, and Prolog.
- Natural language is very easy to use
- Natural languages are associated with expert systems and artificial intelligence.
- These systems are popular in medical and scientific fields and not widely used in business applications.
High-Level Language Advantages
- User-friendly design
- Similar to English
- Less coding time.
- Easier to maintain.
- Problem-oriented
- Can be translated into machine language to run on any computer with a translator.
- Independent of the machine.
High-Level Language Disadvantages
- Needs to be translated, wasting computer time.
- The object code may be inefficient.
Comparison of Computer Languages
Machine Language
- Uses binary digits.
- Directly understood by the computer.
- Example: Character 'A' = 01100001.
Assembly Language
- Uses mnemonics.
- Requires an assembler.
- Example: Addition uses 'Add' (Add A B).
High-Level Language
- Uses English-like language and symbols.
- Requires a compiler.
- Example: Adding 10 and 20 (int s=a + b;).
Source Code and Object Code
- Source code is written in a text editor and converted to machine language.
- Compiler or interpreter converts source code
- Object code is the program converted into machine language.
Compiler
- A compiler translates the entire source code into object code at once.
- It displays the errors for the whole program together.
Interpreter
- It translates the source code line by line before executing.
- It translates one statement at a time.
- Displays errors one line at a time.
Programming Paradigms
- High-level programming languages are classified based on their features
- There are two types of programming paradigms: Procedure-Oriented Programming (POP) and Object-Oriented Programming (OOP).
Procedure-Oriented Programming
- A model for beginners in programming
- It follows a top-down approach.
- Emphasizes methods or procedures over data values.
- Procedure programming splits the programming code into events or procedures, that contain a series of steps or instructions.
- FORTRAN, COBOL, BASIC
Procedure-Oriented Programming Principles
- Follows a top-down approach.
- Divides large programs into smaller functions or methods.
- Provides step-by-step execution instructions.
Procedure-Oriented Programming Advantages
- Reliable and tested algorithms.
- Easy to follow program flow.
- Requires less memory
- Uses functions.
- Programs can be executed on different types of processors.
Procedure-Oriented Programming Disadvantages
- Methods are shared globally.
- Debugging is required in programs.
- Emphasizes operation over data, exposing data.
- Reduces data security.
- Hard to correlate with real-world objects.
Object-Oriented Programming
- It follows a Bottom-Up approach
- It emphasizes more on data rather than functions
- Divides the program into entities, known as objects.
- Increases the ability to deal with complex software problems
Object-Oriented Programming Principles
- Data Abstraction
- Inheritance
- Polymorphism
- Encapsulation
- The four pillars of Object-Oriented Programming
Object-Oriented Programming Advantages
- Each instance has exclusive properties.
- It uses re-usability where code is written once and can be used multiple times using different objects.
- Maintaining and modifying existing code is easier
- Abstraction and Data hiding maintain data security.
- The concept of Inheritance helps avoid data redundancy by allowing code reuse.
Object-Oriented Programming Disadvantages
- Object-Oriented programs need more lines of code
- Requires more memory, and its execution may be slower.
- It requires intensive testing.
- Proper planning is necessary for designing effective programs
Difference between POP and OOP
Procedure-Oriented Programming
- Programs are divided into functions or methods.
- Uses a Top-Down approach.
- Deals with Algorithm/Procedures.
- It is less secure.
- Examples: C, Fortran
Object-Oriented Programming
- Programs are divided into objects.
- Uses the concept of Bottom-Up approach.
- Deals with data.
- It is more secure.
- Examples: C++, Java
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.