XII-computer notes Chapter 1
XII-computer notes Chapter 1
MCQs
1. _______ is a relatively simple high level language that was developed to help students
learn programming
a) BASIC
b) COBOL
c) C
d) All of the above
2. In preparing a program one should first
a) Plan the solution
b) Document the program
c) Code the program
d) Define the program
3. During the development of a program drawing a flowchart is a means to
a) Plan the solution
b) Define the problem
c) Code the program
d) Analyze the problem
4. Which of the following is used to design a program using English like statements?
a) Algorithm
b) Program flowchart
c) Control structure
d) None of the above
5. Compilers are interpreters are types of _____
a) Programming language
b) Language translators
c) Alpha testers
d) Application generators
6. Which of the following type of error is detected by a language translator?
a) Program design
b) Logic
c) Syntax
d) Both b and c
7. You test a program to find which of the following?
a) Flowchart errors
b) Logic errors
c) Algorithm errors
d) Syntax errors
8. In preparing a program desk checking and translation are example of
a) Coding
b) Testing
c) Planning
d) Documenting
9. Which of the following is not one of the steps in a programming project?
a) Planning the solution
b) Coding the program
c) Testing the program
d) Selecting the hardware
10. In preparing a program desk checking and translation are examples of
a) Coding
b) Planning
c) Testing
d) Documenting
11. Comments in the program itself are part of
a) Compiling
b) Translating
c) Linking
d) Documenting
12. The first high level language to eb introduced was
a) COBOL
b) FORTRAN
c) Pascal
d) BASIC
13. The language named for a French mathematician is
a) C
b) Pascal
c) FORTRAN
d) COBOL
14. Specifying the kind of input, processing and output required for a program occurs when
a) Planning the solution
b) Coding the program
c) Flowcharting the problem
d) Defining the problem
15. Error messages provided by a compiler are called
a) Bugs
b) Translations
c) Diagnostics
d) Mistakes
16. After stating a solution in algorithm your would next
a) Test the program
b) Implement the program
c) Code the program
d) Translate the program
17. Software that translates assembly language into machine language is a
a) Binary translator
b) Assembler
c) Compiler
d) Link loader
18. A standardized business language is
a) Pascal
b) COBOL
c) BASIC
d) FORTRAN
19. In developing a program documentation should be done
a) As the last step
b) Only to explain errors
c) Throughout the process
d) Only during the design phase
20. Which of the following language is frequently used in object oriented programming\
a) COBOL
b) C
c) C++
d) Pascal
21. Popular object oriented languages are
a) Pascal, COBOL
b) C++, FORTRAN
c) C++, Smalltalk
d) C)OBOL, BASIC
Q6: Write down the differences between low-level and high-level languages.
Low Level Language High Level Language
In low level language machine codes (0 and 1) are In high level language English like words are used as
used as an instruction to the computer. an instruction to the computer.
The execution of programs is quite fast. The execution of programs is not very fast.
Instructions are directly understood by the CPU and Instruction are not directly understood by the CPU
direct access to memory and less memory efficient.
No need to translate program. In case of assembly Translation of program is required, compiler or
language assembler is required. interpreter.
One type of machine code cannot run on all The high level code can be translated to required
machines so it is not portable language machine code so it is portable language
Coding and maintenance are not easy Coding and maintenance are easy
The programs written in low level languages are The programs written in high level languages are
machine dependent and are difficult to modify. machine independent and are easy to modify.
The examples of low-level languages are:
The examples of high-level languages are: BASIC,
Machine language
FORTRAN, COBOL, PASCAL, C languages etc.
Assembly language
Q8. What is translator? What is the difference between a compile, interpreter and
assembler?
Ans. Programming Language Translator :- A program written in high-level language by the
programmer is called as source code. To convert the source code into machine code, translators
are needed. A translator takes a program written in source language as input and converts it into a
program in target language as output. Translator also detects and reports the error during
translation, whenever the programmer does not follow the rules of syntax of source language.
Compilers, interpreters, and assemblers are the most famous programming language translators
COMPILER: Compiler is a program bat translates the high, level language program into
machine language. Complier translates the whole Program at a time at once before it executed
and makes a separate object file for the translated program. Translated program can he used
multiple time without the need of retranslation of source code. Each high-level language has its
own compiler.
INTERPRETER: Interpreter is a language translator program, which converts high level
program into machine language. It translates one instruction at a time. Interpreter does not make
any object file and it translates the program every time when executed. An interpreter is faster
than a compiler as it immediately executes the codes.
OR
COMPILER INTERPRETER ASSEMBLER
It scans the entire program It translates the program It converts the source code into
before converting it into line by line to the the object code then converts it
binary code. equivalent machine code. into the machine code.