JAC Board Class 12th Computer Science Model Question Paper Solutions 2024-25
झारखण्ड शैक्षणिक अनुसंधान एवं प्रशिक्षण परिषद राँची, झारखण्ड
वार्षिक परीक्षा (Annual Examination)
2024-2025
मॉडल प्रश्न पत्र
कक्षा – XII
Class-XII
विषय – कंप्यूटर विज्ञान
Subject- Computer Science
खंड –A (Section-A)
1. C++ is developed by
A. Dennis Ritchie
B. Ken Thompson
C. Martin Richard
D. Bjarne Stroustrup
2. String Terminator character is
A. ‘|o’
B. ‘|n’
C. ‘|b’
D. None of these
3. DBMS Stands for
A. Database Management System
B. Database Manual System
C. Define Management Solution
D. None of these
4. The smallest individual unit in
A. Semicolon
B. Data type
C. Token
D. Keyword
5. The process of finding the location of the particular element in the array is called
A. Traversal
B. Searching
C. Sorting
D. None of these
6. The Boolean expression A.(B+C)=AB + AC is
A. Associative law
B. Commutative law
C. Absorption law
D. Distributive law
7. Destructor name is preceded by
A. !
B. #
C. $
D. ~
8. The term ‘attribute’ refers to a
A. Table
B. Row
C. Column
D. Relation
9. Main is a /an
A. Object
B. Function
C. Literal
D. None of these
10. F stream class is used for
A. Input operation
B. Output operation
C. Input /Output operation
D. None of these
11. A set of logical operator is
A. + - * / %
B. ?:
C. ><>=<=
D. None of these
12. Pointer is a
A. variable that holds address of other variable
B. Pointer name is preceded by *
C. void pointer is a pointer which can hold the address of any data type
D. All of these.
13. STACK follows
A. GIGO Technique
B. FIFO Technique
C. LIFO Technique
D. None of these
14. When several classes inherit the properties of same common class is called.
A. Single inheritance
B. Multiple inheritance
C. Hierarchical inheritance
D. None of these
15. People standing in a line is an example of
A. STACK
B. QUEUE
C. ARRAY
D. Linked list
16. ………………is a Browser
A. C++
B. Firefox
C. Telnet
D. Cookies
17. A set of conditional / ternary operator(s) is / are
A. +,-,*,/,%
B. >,<,>=,<=,==,!=
C. &&,||,!
D. ?:
18. Which operator has the lowest precedence?
A. Sizeof
B. Unary
C. Assignment
D. Comma
19. In C++ programming strlen() function is used for
A. Count length of string
B. Copy two strings
C. Compare two strings
D. Concatenate two strings
20. In C++ programming array index is always starts from
A. 0
B. 1
C. 2
D. 3
21. Which loop checks the condition on
A. Top
B. Bottom
C. Middle
D. none of these
22. Which of the following is the symbol for AND operator?
A. ||
B. &&
C. &
D. none of these
23. What will be the output of the following condition statement A = 15>15715:16
A. 16
B. 15
C. 31
D. none of these
24. If an array is declared as intarr [5] [5], how many elements can it store?
A. 0
B. 5
C. 10
D. 25
25. In C++ programming '/v' is used for
A. Form feed
B. Line brake
C. Vertical tab
D. Alarm
खंड –B (Section-B)
1. Write the difference between Data and Information.
2. What is Token? What are the names of different types of Token?
3. Clear all the differences between Query Operator and Ternary Operator.
4. With the difference between Union Operator and Ternary Operator.
5. Give the output of the following
void main()
{
int x;
for (x=1;x<=12;x+=2)
cout<<x<<endl;
}
6. What is function? Write the types of function.
7. Explain the concept of Encapsulation.
8. Explain the concepts of minterm and maxterm.
9. Define
a. Hub b. Repeater.
10. What is Inheritance?
Here are the solutions to the questions:
1. Difference between Data and Information:
Data: Raw facts and figures without context (e.g., numbers, characters).
Information: Processed or organized data that has meaning (e.g., a report derived from data).
2. What is a Token? What are the types of Tokens?
Token: The smallest individual unit in a program.
Types: Keywords, Identifiers, Literals, Operators, Special Symbols, and Separators.
3. Differences between Query Operator and Ternary Operator:
Query Operator: Used in database queries to fetch data (e.g., SELECT, WHERE).
Ternary Operator: A conditional operator in programming (condition ? true_result : false_result).
4. Difference between Union Operator and Ternary Operator:
Union Operator: Combines results of two queries in databases.
Ternary Operator: Provides conditional results in a program.
5. Output of the Given Code:
void main()
{
int x;
for (x=1; x<=12; x+=2)
cout << x << endl;
}
Output:
1
3
5
7
9
11
6. What is a Function? Types of Functions:
Function: A block of code designed to perform a specific task.
Types:
Built-in (e.g., printf, sqrt).
User-defined (custom functions).
Recursive.
Inline.
7. Concept of Encapsulation:
Encapsulation involves bundling data and methods that operate on the data within a single unit, typically a class, while restricting access to some components (e.g., using private/public keywords).
8. Concepts of Minterm and Maxterm:
Minterm: A product of literals representing a single combination where the output is 1.
Maxterm: A sum of literals representing a single combination where the output is 0.
9. Define:
Hub: A networking device used to connect multiple devices in a network, working at the physical layer.
Repeater: A device that amplifies and retransmits signals to extend network range.
10. What is Inheritance?
Inheritance is an object-oriented programming concept where a class (child) derives properties and behavior from another class (parent), promoting reusability.
खंड –C (Section-C)
1. Write a program in C++ to find the sum of any five odd numbers.
2. What is Inline function? Write its advantages and disadvantages.
3. Define Data types, Explain different types of datatype with examples.
4. What an algorithm of Bubble sort of Binary search.
5. What is array in C++? Explain its types.
6. Draw the circuit diagram and truth table of X + x̅ Y.3.
7. Define single inheritance and explain with suitable example.
8. What is guided media? Explain.
Here are solutions to the given tasks:
1. Write a program in C++ to find the sum of any five odd numbers.
#include <iostream>
using namespace std;
int main() {
int sum = 0;
int oddNumbers[] = {1, 3, 5, 7, 9}; // Example odd numbers
for (int i = 0; i < 5; i++) {
sum += oddNumbers[i];
}
cout << "The sum of the five odd numbers is: " << sum << endl;
return 0;
}
---
2. What is an Inline function? Write its advantages and disadvantages.
An inline function is a function in C++ whose body is directly inserted into the calling code by the compiler, instead of using a function call.
Advantages:
1. Reduces function call overhead.
2. Speeds up execution by avoiding stack operations.
3. Useful for small, frequently used functions.
Disadvantages:
1. Increases binary file size (code bloat).
2. Compiler may ignore the inline request if the function is too complex.
3. Debugging can be difficult.
---
3. Define data types. Explain different types of data types with examples.
Data types specify the type of data a variable can hold in a program.
Types of Data Types:
1. Primitive types (e.g., int, float, char, bool):
Example: int age = 25;
2. Derived types (e.g., array, pointer, function):
Example: int arr[5] = {1, 2, 3, 4, 5};
3. User-defined types (e.g., struct, class, enum):
Example: struct Point { int x, y; };
---
4. What is an algorithm of Bubble sort and Binary search?
Bubble Sort Algorithm:
1. Start from the first element.
2. Compare adjacent elements and swap if necessary.
3. Repeat for all elements until the array is sorted.
Binary Search Algorithm:
1. Start with a sorted array.
2. Check the middle element.
3. If the key equals the middle element, return its position.
4. If the key is smaller, search the left half; if larger, search the right half.
5. Repeat until the key is found or the array is exhausted.
---
5. What is an array in C++? Explain its types.
An array is a collection of elements of the same data type stored in contiguous memory.
Types of Arrays:
1. One-dimensional array: Example: int arr[5];
2. Two-dimensional array: Example: int matrix[3][3];
3. Multi-dimensional array: Example: int cube[3][3][3];
---
6. Draw the circuit diagram and truth table of X + X̅Y.
Circuit Diagram: Combine an OR gate and an AND gate.
1. OR gate: X and the output of the AND gate.
2. AND gate: X̅ and Y.
Truth Table:
---
7. Define single inheritance and explain with a suitable example.
Single inheritance is when a class inherits from only one parent class.
Example:
#include <iostream>
using namespace std;
class Parent {
public:
void display() {
cout << "This is the parent class." << endl;
}
};
class Child : public Parent {
public:
void show() {
cout << "This is the child class." << endl;
}
};
int main() {
Child obj;
obj.display();
obj.show();
return 0;
}
---
8. What is guided media? Explain.
Guided media refers to physical channels that guide data signals along a specific path.
Types of Guided Media:
1. Twisted-pair cable: Used in telephone lines.
2. Coaxial cable: Used in cable TV.
3. Fiber-optic cable: High-speed data transmission.
खंड –D (Section-D)
1. What is an operator overloading and operator overriding? Explain it with a suitable example.
2. What is an inheritance? What are the different types of inheritance supported in C++? Explain all inheritance supported in C++.
3. Write a program in C++ to find the sum of any five numbers using constructor member functions.
4. Obtain positive notation for the following infix notation manually.
5. What is logic gate? Explain fundamental logic gates with circuit diagram and truth table.
6. Write short notes on the following.
a. DDL b. DBMS
c. Tautology d. Server
Solution
Here are the answers to the provided questions:
---
1. What is operator overloading and operator overriding? Explain it with a suitable example.
Operator Overloading: It is a feature in C++ where existing operators can be redefined to work with user-defined data types.
Example:
#include<iostream>
using namespace std;
class Complex {
int real, imag;
public:
Complex(int r, int i) : real(r), imag(i) {}
Complex operator + (Complex const &obj) {
return Complex(real + obj.real, imag + obj.imag);
}
void display() {
cout << real << " + " << imag << "i" << endl;
}
};
int main() {
Complex c1(3, 4), c2(1, 2);
Complex c3 = c1 + c2;
c3.display();
return 0;
}
Operator Overriding: It occurs in inheritance when a subclass provides its own implementation of a method already defined in the parent class.
---
2. What is inheritance? Types of inheritance in C++?
Inheritance: It is a mechanism in C++ that allows a class (child class) to acquire properties and behaviors of another class (parent class).
Types of Inheritance in C++:
1. Single Inheritance
2. Multiple Inheritance
3. Multilevel Inheritance
4. Hierarchical Inheritance
5. Hybrid Inheritance
---
3. Write a program in C++ to find the sum of five numbers using a constructor.
#include <iostream>
using namespace std;
class Sum {
int total;
public:
Sum(int a, int b, int c, int d, int e) {
total = a + b + c + d + e;
}
void display() {
cout << "The sum is: " << total << endl;
}
};
int main() {
Sum s(5, 10, 15, 20, 25);
s.display();
return 0;
}
---
4. Obtain positive notation for the given infix notation manually.
To convert infix notation to postfix (positive notation):
1. Use an operator precedence table.
2. Apply the shunting-yard algorithm.
Provide the specific infix expression, and I'll solve it step-by-step for you.
---
5. What is a logic gate?
Definition: A logic gate is a building block of digital circuits, performing basic logical functions like AND, OR, and NOT.
Fundamental Logic Gates:
1. AND Gate: Output is true if all inputs are true.
2. OR Gate: Output is true if at least one input is true.
3. NOT Gate: Inverts the input.
Truth Table and Circuit Diagram:
---
6. Short Notes:
DDL (Data Definition Language): Commands like CREATE, ALTER, DROP to define and manage database schema.
DBMS (Database Management System): Software for creating, managing, and interacting with databases (e.g., MySQL, Oracle).
Tautology: A statement that is always true regardless of input (e.g., A OR NOT A).
Server: A machine or software providing services like hosting websites or databases over a network.
MCQS ANSWER
1. D 11. A 21. A
2. D 12. D 22. B
3. A 13. C 23. B
4. C 14. A 24. D
5. B 15. A 25. C
6. D 16. B
7. D 17. D
8. D 18. D
9. B 19. A
```
Comments
Post a Comment