Sunday, 29 December 2024

grade-9:ch-12:programming concept computer ex

 

Chapter-12: Programming Concept

1. fill in the blanks:

(a) written in computer language (b) program (c) hardware (d) electricity billing system (e) line by line (f) QBASIC (g) source

(2) State True or False

(a) True (b) False (c) False (d) False (e) True (f) True (g) True

(3) Full forms:

(a) Prolog = Programming in Logic (b) HLL= High Level Language (c) AL = Assembly Language (d) MLL = Machine Level Language (e) OPS-5 = Official Production System-5 (f) 4GL = Fourth Generation Language (g) 5GL = Fifth Generation Language (h) SQL = Structured Query Language

4. Write short notes on:

Short Notes


(a) Compiler
A compiler is a program that translates high-level programming code into machine language (binary code) in one go. It processes the entire source code, identifies errors, and generates an executable file.
Examples: GCC, Java Compiler.


(b) Interpreter
An interpreter is a program that converts high-level code into machine code line by line during execution. It executes the code directly but is slower than a compiler since it processes code in real time.
Examples: Python Interpreter, JavaScript Engine.


(c) Programming Language
A programming language is a set of rules and syntax used to write instructions that a computer can execute. It allows developers to create software, control hardware, and process data.
Examples: Python, C++, Java.


(d) Fifth Generation Language (5GL)
Fifth Generation Languages are high-level programming languages based on artificial intelligence and natural language processing. These languages aim to make programming more intuitive by using human-like instructions.
Examples: Prolog, Mercury.

5. Answer the following questions in short:

Answers


a. Who is a Programmer?
A programmer is a person who writes, tests, and maintains code to create software, applications, or systems that run on computers or other devices.


b. What is Programming?
Programming is the process of designing, writing, testing, and maintaining instructions (code) for a computer to perform specific tasks.


c. What is a High-Level Programming Language?
A high-level programming language is a language that uses human-readable syntax, making it easier to write and understand. It abstracts the complexities of hardware and is platform-independent.
Examples: Python, Java.


d. Which Language is Understood by a Computer?
A computer understands machine language or binary code (a series of 0s and 1s).


e. Write Two Examples of High-Level Languages.

  1. Python
  2. C++


f. What is Mnemonic Code?
Mnemonic code refers to symbolic instructions used in assembly language to represent machine-level instructions. It makes programming easier by using abbreviations instead of binary.
Example: MOV, ADD.


g. What is Fifth Generation Language?
Fifth Generation Languages (5GL) are high-level programming languages designed for artificial intelligence and natural language processing. They focus on problem-solving rather than writing detailed instructions.
Examples: Prolog, Mercury.

6. Answer the following questions:

Answers


a. What is a Programming Language? Write the Names of Different Types of Programming Language.
A programming language is a set of instructions and rules used to write programs that can be executed by a computer.

Types of Programming Languages:

  1. Machine-Level Language
  2. Assembly Language
  3. High-Level Language
  4. Fourth Generation Language (4GL)
  5. Fifth Generation Language (5GL)


b. Write Any Two Advantages and Two Disadvantages of High-Level Programming Language.
Advantages:

  1. Easy to read, write, and maintain.
  2. Platform-independent, allowing portability.

Disadvantages:

  1. Slower execution compared to low-level languages.
  2. Requires a compiler or interpreter for execution.


c. What is Machine-Level Language? Write Its Two Advantages and Two Disadvantages.
Machine-level language is the lowest-level programming language that is directly understood by the computer. It consists of binary code (0s and 1s).

Advantages:

  1. Directly executed by the hardware, ensuring fast performance.
  2. No need for a translator as it is understood by the computer.

Disadvantages:

  1. Difficult to understand, write, and debug.
  2. Not portable; specific to a particular machine's architecture.


d. What Are Language Processors? Give Examples of Language Processors.
Language processors are software tools that convert high-level or assembly language code into machine code.

Examples:

  1. Compiler
  2. Interpreter
  3. Assembler


e. Define Assembly Language. Write Its Advantages and Disadvantages.
Assembly language is a low-level language that uses mnemonic codes to represent machine-level instructions.

Advantages:

  1. Easier to understand and write compared to machine-level language.
  2. Provides better control over hardware resources.

Disadvantages:

  1. Machine-dependent and not portable.
  2. Still more complex than high-level languages.


f. Differentiate Between the Compiler and the Interpreter.

Aspect Compiler Interpreter
Execution Translates the entire code at once. Translates and executes line by line.
Speed Faster after compilation. Slower due to real-time translation.
Error Detection Displays all errors after compilation. Displays errors immediately.
Output Produces an executable file. Does not produce an executable file.


g. What is 4GL? Write Advantages and Disadvantages of It.
Fourth Generation Language (4GL) is a high-level programming language designed to simplify coding by using natural language and declarative programming.

Advantages:

  1. Increases productivity by reducing development time.
  2. Easy to use for non-programmers.

Disadvantages:

  1. Limited control over hardware and system performance.
  2. Can be slower compared to lower-level languages.

No comments:

Post a Comment

Popular Posts