HBSE Class 12 Computer Science Question Paper 2024 Answer Key

Haryana Board (HBSE) Class 12 Computer Science Question Paper 2024 Answer Key. BSEH (Board of School Education Haryana) Class 12 Computer Science Answer Key 2024. HBSE (Haryana Board of School Education) Class 12 Computer Science Solved Question Paper 2024. BSEH Class 12 Computer Science Paper 2024 Solution. Download PDF and check accurate answers carefully prepared through my personal understanding, subject knowledge, and dedication to help students based on the syllabus and exam pattern.

HBSE Class 12 Computer Science Question Paper 2024 Answer Key

1. (i) What does FTP stand for?
(A) File Type Processor
(B) Full Text Processing
(C) File Transfer Protocol
(D) Fast Transmission Protocol
Answer – (C) File Transfer Protocol

(ii) Which SQL function is used to retrieve the smallest value from a specific column in a database table?
(A) LEAST ()
(B) MIN ()
(C) SMALLEST ()
(D) BOTTOM ()
Answer – (B) MIN ()

(iii) Which HTML tag is used to create a hyperlink in a Webpage?
(A) <u>
(B) <h>
(C) <a>
(D) <p>
Answer – (C) <a>

(iv) If the elements “P”, “Q”, “R” and “S” are placed in a stack and are deleted one at a time, in what order will they be removed?
(A) PRSQ
(B) RSPQ
(C) SRQP
(D) PQRS
Answer – (C) SRQP

(v) …………… Tag is used for making the text underline in HTML.
Answer : <u>

(vi) ………….. unary operator, increments the value of the operand by 1.
Answer : ++

(vii) Structure is a user-defined data type that can contain variables of different data types. (True / False)
Answer – True

(viii) The <h1> tag in HTML is used to define the least level/the least important heading. (True / False)
Answer – False

(ix) Assertion (A) : The full form of SQL is Simple Query Language.
Reason (R) : SQL is used to retrieve and manage data in relational databases.
(A) Both Assertion (A) and Reason (R) are correct and Reason (R) is the correct explanation of Assertion (A).
(B) Both Assertion (A) and Reason (R) are correct and Reason (R) is not the correct explanation of Assertion (A).
(C) Assertion (A) is true, but Reason (R) is false.
(D) Assertion (A) is false, but Reason (R) is true.
Answer – (D) Assertion (A) is false, but Reason (R) is true.

(x) Assertion (A) : A URL (Uniform Resource Locator) is like the address of a webpage on the internet.
Reason (R) : Web browsers use URLs to locate and retrieve Webpages from the World Wide Web.
(A) Both Assertion (A) and Reason (R) are correct and Reason (R) is the correct explanation of Assertion (A).
(B) Both Assertion (A) and Reason (R) are correct and Reason (R) is not the correct explanation of Assertion (A).
(C) Assertion (A) is true, but Reason (R) is false.
(D) Assertion (A) is false, but Reason (R) is true.
Answer – (A) Both Assertion (A) and Reason (R) are correct and Reason (R) is the correct explanation of Assertion (A).

2. Write syntax of “for” loop in C++.
Answer – for (initialization; condition; increment/decrement) {
// statements
}

3. Name any two types of constructor.
Answer – (i) Default Constructor
(ii) Parameterized Constructor

4. Define 2NF.
Answer – A table is in 2NF if it is in 1NF and all non-key attributes are fully functionally dependent on the primary key.

5. Write the syntax of INSERT command in SQL used to insert data into a table.
Answer – INSERT INTO table_name (column1, column2, …)
VALUES (value1, value2, …);

6. Examine the following table named ‘Student_Course’ from the student_data’ database :

Stu_IDStu_NameStu_Course
101AHindi, Maths
102BHindi, Bio
103CComputer, Bio
104DComputer, Maths

(i) Is the given table in First Normal Form (1NF)?
(A) Yes
(B) No
(C) Cannot be determined
Answer – (B) No

(ii) What is the key characteristic of First Normal Form (1NF)?
(A) Multiple values in each column
(B) Non-atomic values in each column
(C) Atomic/Single values in each column
(D) None of these
Answer – (C) Atomic/Single values in each column

OR

Explain any two DDL Commands in SQL with example.
Answer – (i) CREATE: Used to create a new table or database.
(ii) ALTER: Used to modify an existing table.

7. Explain, with an example, how to define a function outside a class in C++.
Answer – In C++, a member function of a class can be defined outside the class using the scope resolution operator (::). This operator explicitly links the function definition to its respective class.

• Example:
#include <iostream>
using namespace std;

class Student {
public:
void display(); // Function declaration inside class
};

// Function definition outside the class
void Student::display() {
cout << “Hello, I am a student.” << endl;
}

int main() {
Student s;
s.display(); // Calling the function
return 0;
}

8. Explain SUM () function, its syntax in SQL with example.
Answer – The SUM() function in SQL is used to calculate the total (sum) of values in a numeric column.

• Syntax:
SELECT SUM(column_name) FROM table_name;

• Example:
SELECT SUM(Salary) FROM Employees;

9. How to add an image in a Webpage using HTML?
Answer – For adding an image in a webpage using HTML, you use the <img> tag. This tag is self-closing and requires the ‘src’ attribute to specify the image path, and usually the ‘alt’ attribute for alternative text.

• Syntax:
<img src=”image_path” alt=”description”>

• Example:
<img src=”flower.jpg” alt=”A red flower”>

10. A 12th-class student is working on her school project about eco-friendly practices. She cares about the environment, which is why she uses digital copies instead of paper. She is exploring different websites using a browser on her computer. She explores many web addresses through website links using a search engine and completes her project.
Questions :
(i) Which of the following is an example of a browser?
(A) Microsoft Word
(B) Google Chrome
(C) Adobe Photoshop
(D) Excel Spreadsheet
Answer – (B) Google Chrome

(ii) Why does she use search engine for her project?
(A) To draw digital pictures
(B) To edit project photos
(C) To find relevant information quickly
(D) To organize project files
Answer – (C) To find relevant information quickly

11. What is a linear queue in data structure? Write and explain an algorithm to insert an element into a linear queue.
Answer – A linear queue is a linear data structure that adheres to the First-In-First-Out (FIFO) principle, meaning the first element added to the queue is the first one to be removed. It has two distinct ends: the front where elements are removed (dequeue operation), and the rear where elements are added (enqueue operation). This structure mimics real-world queues, such as a line of people waiting for service.
• Algorithm to Insert (Enqueue) an Element in a Linear Queue :
1. Check Overflow:
If rear == MAX – 1, then queue is full → insertion not possible.
2. Initialize Front:
If front == -1, then set front = 0.
3. Insert Element:
Increment rear = rear + 1.
4. Store Element:
queue[rear] = item.
5. End.

OR

What is sorting? Explain Bubble Sort in detail with example.
Answer – Sorting is the process of arranging data in a specific order, such as ascending or descending. It makes searching and analysis easier.
• Bubble Sort is a simple comparison-based sorting method. It works by repeatedly going through the list, comparing each pair of adjacent elements, and swapping them if they are in the wrong order. This continues until the list is completely sorted. For example, if we have the list [5, 3, 8, 4], then in the first pass 5 and 3 are compared and swapped to get [3, 5, 8, 4]. Next, 5 and 8 remain as they are, but 8 and 4 are swapped to give [3, 5, 4, 8]. In the second pass, 5 and 4 are compared and swapped, resulting in [3, 4, 5, 8]. After the third pass, the list is fully sorted in ascending order: [3, 4, 5, 8].

12. What is SDLC? Explain any three phases of SDLC in detail.
Answer – SDLC stands for System Development Life Cycle. It is a step-by-step process used to design, develop, test, and implement software systems. The main goal of SDLC is to produce high-quality software that meets user requirements within time and budget.
• Three Phases of SDLC :
(i) Requirement Analysis – In this phase, developers and analysts meet users to understand what the system should do. All functional and non-functional requirements are collected and documented. This ensures the software is developed according to user needs.
(ii) Design Phase – Based on the requirements, the overall system design is created. It includes database design, user interface design, and system architecture. This phase provides a blueprint for the actual coding.
(iii) Testing Phase – After coding, the system is tested to find and remove errors. Different types of testing like unit testing, integration testing, and system testing are performed to make sure the software works correctly and reliably.

OR

Explain the following :
(a) Black Box Testing
Answer – Black Box Testing is a method of testing software where the tester does not look at the internal code. Only the inputs and expected outputs are checked to ensure the software behaves correctly. It focuses on functionality rather than code structure.

(b) White Box Testing
Answer – White Box Testing is a method where the tester examines the internal logic, code, and structure of the program. It ensures that all statements, loops, and conditions in the code are working correctly.

(c) Unit Testing
Answer – Unit Testing involves testing individual modules or components of a program separately. It helps to find and fix errors in each small part before integrating them into the full system.

(d) Integration Testing
Answer – Integration Testing checks how different modules of a software work together. It ensures that the combined parts interact correctly and the system functions as intended.

13. Describe the TCP/IP model in networking and explain the workings of any two layers of this model.
Answer – The TCP/IP model is a network model that describes how data is transmitted over the internet. It divides communication into layers, where each layer has a specific role in sending and receiving data. The model helps in designing and understanding network protocols.
• Two Layers of TCP/IP Model :
(i) Internet Layer – This layer is responsible for addressing and routing data packets so that they reach the correct destination. It uses IP addresses to identify devices on the network and finds the best path for data transfer.
(ii) Transport Layer – This layer ensures reliable data delivery between devices. It breaks large messages into smaller segments and manages their delivery. Protocols like TCP (for reliable delivery) and UDP (for fast delivery) work at this layer.

OR

Explain the following :
(a) LAN
Answer – LAN (Local Area Network) is a network that connects computers and devices within a small area, such as a home, office, or school. It allows sharing of resources like files, printers, and internet among connected devices.

(b) MAN
Answer – MAN (Metropolitan Area Network) is a network that covers a larger area than LAN, such as a city or town. It is used to connect multiple LANs together for communication and resource sharing over a wider area.

(c) WAN
Answer – WAN (Wide Area Network) is a network that spans a very large area, even across countries or continents. The Internet is the largest example of a WAN. It connects multiple LANs and MANs over long distances.

(d) WWW
Answer – WWW (World Wide Web) is a system of interlinked web pages accessible through the Internet. It allows users to view and access information, multimedia, and services using a web browser.

14. Describe Inheritance in C++ and explain Single, Multiple and Multilevel inheritance.
Answer – Inheritance in C++ is a feature that allows a class (child) to acquire properties and behaviors (data members and functions) of another class (parent). It helps in code reusability and building hierarchical relationships between classes.
• Types of Inheritance :
(i) Single Inheritance – In single inheritance, a child class inherits from only one parent class.
Example: class B : public A { … };
(ii) Multiple Inheritance – In multiple inheritance, a child class inherits from more than one parent class.
Example: class C : public A, public B { … };
(iii) Multilevel Inheritance – In multilevel inheritance, a class is derived from another derived class, forming a chain.
Example: class B : public A { … }; class C : public B { … };

OR

Explain the concept of a destructor using a suitable programming example in C++.
Answer – A destructor is a special member function of a class that is automatically called when an object goes out of scope or is destroyed. Its main purpose is to release resources like memory or file handles that the object may have acquired. A destructor has the same name as the class but is preceded by a tilde (~) and does not take any parameters or return a value.

• Example:
#include <iostream>
using namespace std;

class Demo {
public:
Demo() {
cout << “Constructor called” << endl;
}
~Demo() {
cout << “Destructor called” << endl;
}
};

int main() {
Demo obj; // Constructor is called here
// Some operations
return 0; // Destructor is called automatically here
}

• Output :
Constructor called
Destructor called