UNIT 02. BASICS OF PROGRAMMING IN C++ - MCQs - Computer Science For Class X
UNIT 02. BASICS OF PROGRAMMING IN C++ - MCQs - Computer Science For Class X
GO TO INDEX
Computer Science For Class X
Unit 02: Basics Of Programming In C++
Multiple Choice Questions And Fill In The Blanks
Multiple Choice Questions (MCQs)
A. ENCIRCLE THE CORRECT ANSWER:1. A computer program is a collection of:
a. Tasks
b. Instructions ✓
c. Computers
d. Programmers
2. High-level languages have syntax that is:
a. Easily readable by humans ✓
b. Easily readable by machines
c. Easily readable by both
d. None of the above
3. Low-level languages have syntax that is:
a. Easily readable by humans
b. Easily readable by machines ✓
c. Easily readable by both
d. None of the above
4. The primary characteristic of a compiler is to:
a. Translate codes line-by-line
b. Translate low-level code to machine language
c. Detect logical errors
d. Translate codes all at once ✓
5. The primary characteristic of an interpreter is to:
a. Translate codes line-by-line ✓
b. Translate low-level code to machine language
c. Detect logical errors
d. Translate codes all at once
6. An Integrated Development Environment facilitates a programmer to:
a. Edit source code
b. Complete and highlight syntaxes
c. Debug and compile codes
d. All of the above ✓
7. All errors, detected by users are typically:
a. Syntax Errors
b. Semantic Errors
c. Run- Time Errors
d. Logical Errors ✓
8. Allowed names for declaring a variable:
a. Can contain whitespaces
b. Can be one of the reserved words
c. Can contain letters, digits and underscores ✓
d. Can be the same as its data type
9. A bool data can store following type of value:
a. Numbers
b. Strings
c. Fractional numbers
d. True or false ✓
10. Which data type occupies the most space in memory?
a. Character
b. Integer
c. Floating point
d. Double floating point ✓
11. An identifier cannot consist more than characters:
(a) 30
(b) 31 ✓
(c) 32
(d) 35
12. Integer reserves ___ bytes in memory:
(a) 2
(b) 4 ✓
(c) 8
(d) 35
13. Float data type consists of the following:
(a) Numbers only
(b) Numbers and decimal point ✓
(c) Special characters
(d) Alphabets
14. Which of the following type of errors is detected by a language translator:
(a) Program design
(b) Logical errors
(c) Arithmetic errors
(d) Syntax errors ✓
15. A pictorial representation of program is called:
(a) A flowchart ✓
(b) An algorithm
(c) Pseudocode
(d) None of these
16. Software that translates assembly language into machine language is a/an:
(a) Binary translator
(b) Assembler ✓
(c) Compiler
(d) Link-loader
17. This type of error is detected by compiler:
(a) Runtime
(b) Logical
(c) Syntax ✓
(d) None of these
18. This is statement terminator in C:
(a) { }
(b) ; ✓
(c) "
(d) None of these
19. IDE stands for:
(a) International Development Environment ✓
(b) Integrated Development Environment
(c) Important Design Environment
(d) None of the above
20. Double/floating point reserves ____ bytes in memory:
(a) 4
(b) 6
(c) 8 ✓
(d) 10
21. A char data type contains any valid enclosed in a single quote:
(a) Alphabets only
(b) Symbols only
(c) ASCII characters ✓
(d) None of them
22. There are basic types of constant:
(a) 2 ✓
(b) 4
(c) 6
(d) 7
23. An integer constant must not have ___.
(a) Positive
(b) Negative
(c) Decimal Point ✓
(d) Numbers
24. ___ is a program that converts high-level language to machine language.
(a) Assembler
(b) Compiler ✓
(c) Debugger
(d) Linker
25. Which of the following is used to link all the parts of the program together for execution?
(a) Loader
(b) Linker ✓
(c) Memory
(d) Preprocessor
26. The output of an assembler is called:
(a) Data file
(b) Task file
(c) Object file ✓
(d) Program file
27. Users write the programs in which language?
(a) Low-level Language
(b) Middle-level Language
(c) Decimal-format
(d) High-level language ✓
28. A type of error that cannot be detected by a language translator is said to be:
(a) Syntax error
(b) Logical error ✓
(c) Inception error
(d) Conception error
29. Type of error generated by some undefined terms or wrong spelling term in a program is known as:
(a) Compile error
(b) Runtime error
(c) Conception error
(d) Syntax error ✓
30. A type of error that a language translator can detect is called:
(a) Compiler error
(b) Syntax error ✓
(c) Conception error
(d) Runtime error
31. Error in planing a program's logic would generate a ___.
(a) Inception error
(b) Conception error
(c) Syntax error
(d) Logic error ✓
32. Which is a valid identifier or variable name?
(a) diameter ✓
(b) void
(c) 55
(d) $12
33. A runtime error ___ program execution at the statement that cannot be executed.
(a) Halts ✓
(b) Resumes
(c) Starts
(d) None of the above
34. The constant are also called as ___:
(a) Const
(b) Preprocessor
(c) Literals ✓
(d) None of the above
35. The ___ are just like variables except that their values cannot be changed.
(a) Named constant
(b) Basic constant
(c) Number constant
(d) Symbolic constant ✓
Fill In The Blanks:
- A computer program is a list of instructions that tell a computer what to do.
- We refer to syntax in computer programming as the concept of giving specific word sets in specific orders to computers so that they do what we want them to do.
- Different programming languages can be classified into high, middle and low-level languages.
- High-level languages are easy to read for humans and contain English language like words.
- Middle-level languages have a human readable format along with direct control over the machine's resources.
- Low-level languages are easy for machines to read and hard for humans.
- Low-level programs mostly comprise of binary digits and memory operators.
- There are three types of translators namely, compilers, interpreters and assemblers.
- Compilers convert high-level languages into machine readable format.
- Interpreters also convert high-level programs into machine readable format.
- Interpreters convert instructions line-by-line.
- Assemblers convert low-level languages into machine readable format with added benefit of being interactive like an interpreter.
- Programming errors prevent the program from being compiled or executed.
- Syntax errors are words or symbols unrecognized by a particular programming language.
- Runtime errors only occur during program execution mostly due to an invalid input.
- Logical errors are considered when incorrect results are obtained based on provided input.
- Logical errors do not interrupt program execution.
- IDEs stand for Integrated Development Environments.
- Integrated Development Environments (IDEs) are programs that facilitate writing, compiling and executing codes.
- IDEs usually provide a single environment for programmers to write and executes codes efficiently.
- C++ is a general-purpose high-level programming language.
- Reserved words are part of programming language syntax and cannot be used as name of variable, function or label.
- A constant is a named identifier having a value that cannot be changed.
- A variable is a named identifier with a value that can be changed during normal execution of program.
- Different types of values can be stored in variables. These types are called data types such as int, string, bool, etc.
- A variable can be declared by giving it a name and type.
- A variable can also be initialized during declaration by assigning a value to it.
- In C++, a variable is defined and initialized as: "data type variable name= value;"
- C++ offers various data types for holding values in variables.
Comments
Post a Comment
If you have any doubts, Please let me know .