Class 12 Computer Model Question Solution 2082
Getting ready for your Grade 12 Computer Science exam under the NEB 2082 (2024) syllabus? You're in the right place. This guide gives you clear, straight answers to the NEB Class 12 Computer Science Model Questions. No fluff. Just what you need. Whether you're cramming for finals or reviewing a little each day, these solutions will sharpen your thinking, strengthen your problem-solving, and build real confidence.
๐ Group A: Multiple Choice Questions
(Rewrite the correct option for each question in your answer sheet.) [9x1=9]
1. In which normal form of database, atomicity is introduced?
A) First B) Second C) Third D) Fourth
✅ Answer: A) First
๐ Explanation:
The concept of atomicity—where each attribute holds only indivisible values—is introduced with the First Normal Form (1NF). It ensures that every column contains atomic, non-divisible data, making data storage more efficient and consistent.
2. Which of the following techniques is not implemented to protect a database?
A) Rollback B) Backup C) Recovery D) Firewall
✅ Answer: D) Firewall
๐ Explanation:
A firewall is used to safeguard a network—not a database directly. It acts as a barrier between internal networks and external threats. In contrast, rollback, backup, and recovery are database-specific techniques for data protection and restoration.
3. Which one of the following SQL commands is executed to display all the records having a second letter in the LNAME (LAST NAME) as “A” from the customer table?
A) SELECT * FROM CUSTOMER WHERE LNAME LIKE “?A%”;
B) SELECT * FROM CUSTOMER WHERE LNAME LIKE “_A%”;
C) SELECT * FROM CUSTOMER WHERE LNAME LIKE “A%”;
D) SELECT * FROM CUSTOMER WHERE LNAME LIKE “%A”;
✅ Answer: B) SELECT * FROM CUSTOMER WHERE LNAME LIKE "_A%"
๐ Explanation:
The underscore (_) in SQL acts as a wildcard for any single character. The pattern "_A%" matches names where the second character is A. % matches any sequence after that. Hence, the query fetches records where the second character of the last name is "A".
4. Which of the following is an incorrect IP address?
A) 192.168.0.1 B) 192.168.1 C) 172.255.0.0 D) 202.10.79.4
✅ Answer: B) 192.168.1
๐ Explanation:
A valid IPv4 address must have four octets (e.g., 192.168.0.1). The option 192.168.1 is invalid because it only includes three parts, not the required four.
5. Which of the following is a server-side scripting language?
A) JavaScript B) MySQL C) PHP D) jQuery
✅ Answer: C) PHP
๐ Explanation:
PHP is a popular server-side language used to build dynamic websites. The code runs on the server and generates HTML before being sent to the client’s browser. Unlike JavaScript or jQuery, which run on the client side, PHP handles logic at the server level.
6. Which of the following keywords are used to declare a variable in JavaScript?
A) int or var B) float or let C) var or let D) char or var
✅ Answer: C) var or let
๐ Explanation:
JavaScript supports variable declarations using var, let, and const. While var has function-level scope, let is block-scoped, making it a better modern choice for variable declarations.
7. Which of the following commands is executed in PHP to concatenate the variables $x with $y?
A) $x + $y B) $x=$y C) concat($x,$y) D) $x.$y
✅ Answer: D) $x.$y
๐ Explanation:
In PHP, the dot (.) operator is used to concatenate strings. So $x . $y merges the values of the two variables into one string.
8. Which statement is incorrect about the object-oriented approach?
A) Emphasis is on data rather than procedure.
B) Data is hidden and cannot be accessed.
C) Objects communicate through functions.
D) It supports abstract data but not the class.
✅ Answer: D) It supports abstract data but not the class.
๐ Explanation:
This is incorrect because object-oriented programming is based on classes, which are blueprints for creating objects. It supports both abstract data types and class-based structure.
9. Which of the following feasibility study is concerned with cost benefit analysis?
A) Technical feasibility B) Economic feasibility
C) Operational feasibility D) Schedule feasibility
✅ Answer: B) Economic feasibility
๐ Explanation:
Economic feasibility assesses whether the project is financially viable, weighing the expected costs against the projected benefits. This is crucial in decision-making, especially in business environments.
Group B: Short Answer Questions
[5 Questions × 5 Marks = 25 Marks]
10. Which type of database system (centralized or distributed) is mostly preferred by financial institutions like a bank? Give any four suitable reasons.
[1+4]
✅ Answer:
Banks and other financial organizations generally opt for a centralized database system over a distributed one. Here are four reasons supporting this preference:
-
1. High Data Consistency:
Centralized systems store all data in a single location, ensuring consistency and minimizing discrepancies — a vital factor in banking operations where precision is essential. -
2. Stronger Security Controls:
With all access points being routed through one system, it becomes easier to implement and manage robust security protocols, reducing the risk of breaches. -
3. Simplified Maintenance and Scaling:
Upgrading or expanding storage or processing power is more straightforward and cost-effective in a centralized setup compared to distributed networks. -
4. Faster Transaction Processing:
Since data is accessed from a single source, transaction handling is quicker and more efficient — crucial for real-time banking services.
✅ Centralized databases provide reliability, data integrity, and control, making them ideal for institutions where accuracy and security are non-negotiable.
OR
Nowadays most of the business organizations prefer applying relational model for database design in comparison to other models. Justify the statement with your arguments.
✅ Answer:
Many modern businesses favor the relational database model due to its versatility and robust structure. Here’s why:
-
1. Easy to Understand and Use:
Relational databases organize data in tables, making the structure more intuitive for developers and non-technical users alike. -
2. High Flexibility:
Adding or modifying data structures can be done with minimal disruption, which is beneficial for businesses with evolving data needs. -
3. Enforces Data Integrity:
Constraints and relationships between tables help maintain accurate, consistent, and valid data, minimizing errors. -
4. Scalable and Efficient:
These systems handle growing data volumes effectively, accommodating more users and queries without major redesigns. -
5. Broad Compatibility:
Supported by a wide range of software tools and programming languages, relational models integrate smoothly into diverse IT environments.
✅ These features make relational models a go-to choice for organizations seeking reliability, efficiency, and long-term maintainability.
11. Develop a program in JavaScript to exchange/swap the values of any two variables.
✅ Answer:
<script>
// Declare and assign values to two variables
let a = 10;
let b = 20;
// Display original values
console.log("Before swapping:");
console.log("a = " + a);
console.log("b = " + b);
// Swap values using a temporary variable
let temp = a;
a = b;
b = temp;
// Display swapped values
console.log("After swapping:");
console.log("a = " + a);
console.log("b = " + b);
</script>
This program uses a temporary variable temp
to hold one value during the swap process. It prints the variable values before and after the swap to verify correctness.
OR
How can you connect a database with PHP? Demonstrate with an example.
✅ Answer:
<?php
// Define database connection details
$servername = "localhost";
$username = "root";
$password = "12345678";
$database = "example_db";
// Establish connection
$conn = new mysqli($servername, $username, $password, $database);
// Check for connection errors
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Database connection successful.";
// Close the connection
$conn->close();
?>
๐ Explanation:
-
The script begins by setting up credentials for the database.
-
Then, a new MySQLi object is created to initiate the connection.
-
If the connection fails, an error message is shown.
-
If successful, a confirmation message is displayed.
-
Finally, the connection is closed using
$conn->close()
.
12. Describe the concept of Object Oriented and Procedure Oriented Programming in brief.
[2+3]
✅ Answer:
-
Object-Oriented Programming (OOP):
OOP organizes code around objects — data structures that contain both data and functions. It emphasizes principles like encapsulation, inheritance, and polymorphism, offering a modular and reusable coding approach. -
Procedure-Oriented Programming (POP):
POP focuses on a sequence of procedures or functions that operate on data. Code is written as step-by-step instructions. It emphasizes logic and workflow rather than entities and objects.
✅ OOP is ideal for large-scale applications requiring scalability and maintainability, while POP suits simpler, smaller programs with linear logic.
13. Write down any five qualities of good software.
✅ Answer:
Here are five key qualities that define effective software:
-
Functionality:
It should fulfill all the specified requirements and perform its intended tasks correctly. -
Reliability:
The software must operate consistently and be free of critical errors, even under stress. -
Maintainability:
The codebase should be easy to update, debug, and enhance without disrupting existing functions. -
Usability:
A clean, intuitive interface ensures users can operate the software with minimal learning effort. -
Efficiency:
The software should optimize use of system resources, offering fast performance without hogging memory or CPU.
✅ These characteristics ensure that the software not only works correctly but also provides a smooth and effective user experience.
14. Explain mobile computing with its advantages and disadvantages.
✅ Answer:
Mobile computing allows users to perform computing tasks from portable devices like smartphones, laptops, and tablets — anytime, anywhere, using wireless networks.
✅ Advantages:
-
Portability:
Access information and applications from almost anywhere. -
Real-time Access:
Stay connected to cloud services or company data systems on the move. -
Improved Productivity:
Enables remote work and on-the-go communication, improving output. -
Enhanced Collaboration:
Teams can collaborate instantly via mobile apps and messaging platforms. -
Entertainment and Convenience:
Offers access to multimedia, navigation, and e-commerce services.
❌ Disadvantages:
-
Security Risks:
Mobile devices are more vulnerable to theft, hacking, and malware. -
Limited Battery Life:
Continuous use drains power quickly, affecting usability. -
Reduced Performance:
Mobile devices typically lack the processing power of desktops. -
Connectivity Issues:
Dependence on wireless networks can lead to performance drops in low-signal areas. -
Distractions:
Notifications and non-work apps can interrupt focus and reduce productivity.
✅ While mobile computing enhances flexibility and responsiveness, it requires careful management of security, performance, and connectivity concerns.
✅ That completes the Group B answers with original, optimized content.
Would you like me to now proceed to Group C (Long Answer Questions) next?
Thank you! Let's now complete Group C: Long Answer Questions [2x8=16] — fully rephrased, SEO-optimized, and plagiarism-free, while keeping the original questions exactly the same.
Group C: Long Answer Questions
[2 Questions × 8 Marks = 16 Marks]
15. Why do most of the business organizations prefer setting their network with the client-server architecture? Write its advantages and disadvantages. [2+6]
✅ Answer:
Most businesses adopt the client-server architecture because it allows centralized control, enhanced data security, and efficient resource sharing. It’s especially useful in environments that require robust, scalable, and manageable IT infrastructure.
✅ Advantages of Client-Server Architecture:
-
Centralized Resource Management:
All key resources such as databases, files, and applications are stored and managed on a central server, which makes monitoring and maintenance much easier. -
Scalability:
New client machines can be added without changing the core system. This makes the architecture ideal for growing businesses. -
Enhanced Security:
Since all sensitive data is stored on the server, centralized security policies can be enforced effectively to protect against unauthorized access. -
Better Performance:
With dedicated servers handling complex operations, client machines can operate more smoothly and quickly, especially in high-demand environments. -
Data Backup and Recovery:
Central servers make it easier to implement automatic backups and recovery plans, ensuring data is not lost in case of failures. -
Easier Maintenance and Updates:
Software updates or patches can be deployed on the server once and reflected across all client machines instantly, saving time and effort.
❌ Disadvantages of Client-Server Architecture:
-
Higher Initial Cost:
Setting up dedicated server hardware and networking components can be expensive, especially for small businesses. -
Single Point of Failure:
If the server experiences a failure, all connected clients may lose access to critical resources, leading to downtime. -
Network Dependency:
Functionality relies heavily on network availability. If the network is slow or fails, the whole system's performance suffers. -
Complex Setup and Management:
Installing and maintaining server infrastructure requires skilled IT professionals, which can increase operational costs.
✅ In summary, client-server architecture offers centralized control, scalability, and reliability, making it a top choice for modern business environments — provided that the setup is properly maintained and secured.
16. Develop a program in C using structure to ask the information of any 12 students with roll_number, name and marks scored in sub1, sub2, and sub3. Also, display them in proper format along with the calculation of total and percentage. [Note: the full marks of each subject is 100].
✅ Answer:
#include <stdio.h>
struct Student {
int roll_number;
char name[50];
int sub1;
int sub2;
int sub3;
int total;
float percentage;
};
int main() {
struct Student students[12];
int i;
printf("Enter details of 12 students:\n");
for (i = 0; i < 12; i++) {
printf("\nStudent %d:\n", i + 1);
printf("Roll Number: ");
scanf("%d", &students[i].roll_number);
printf("Name: ");
scanf("%s", students[i].name);
printf("Marks in Subject 1: ");
scanf("%d", &students[i].sub1);
printf("Marks in Subject 2: ");
scanf("%d", &students[i].sub2);
printf("Marks in Subject 3: ");
scanf("%d", &students[i].sub3);
students[i].total = students[i].sub1 + students[i].sub2 + students[i].sub3;
students[i].percentage = students[i].total / 3.0;
}
printf("\n\n%-10s %-15s %-6s %-6s %-6s %-6s %-10s\n", "Roll No", "Name", "Sub1", "Sub2", "Sub3", "Total", "Percent");
printf("---------------------------------------------------------------\n");
for (i = 0; i < 12; i++) {
printf("%-10d %-15s %-6d %-6d %-6d %-6d %-9.2f%%\n",
students[i].roll_number,
students[i].name,
students[i].sub1,
students[i].sub2,
students[i].sub3,
students[i].total,
students[i].percentage);
}
return 0;
}
๐ Explanation:
-
A structure
Student
is defined to hold each student’s details. -
Input is collected for 12 students, including roll number, name, and marks for three subjects.
-
Total marks and percentage are calculated for each student.
-
The program then displays the results in a neat tabular format.
OR
Demonstrate a program in C to create a data file named score.dat to store students’ information with Reg_no, name, gender, and address. The program should ask the user to continue or not. When finished, the program should also display all the records in the proper format.
✅ Answer:
#include <stdio.h>
#include <stdlib.h>
struct Student {
int reg_no;
char name[50];
char gender[10];
char address[100];
};
int main() {
struct Student s;
FILE *fp;
char choice;
fp = fopen("score.dat", "wb");
if (fp == NULL) {
printf("Error: Unable to create file.\n");
exit(1);
}
do {
printf("\nEnter Student Information:\n");
printf("Registration Number: ");
scanf("%d", &s.reg_no);
printf("Name: ");
scanf("%s", s.name);
printf("Gender: ");
scanf("%s", s.gender);
printf("Address: ");
scanf("%s", s.address);
fwrite(&s, sizeof(struct Student), 1, fp);
printf("Do you want to add another record? (y/n): ");
scanf(" %c", &choice);
} while (choice == 'y' || choice == 'Y');
fclose(fp);
fp = fopen("score.dat", "rb");
if (fp == NULL) {
printf("Error: Unable to open file.\n");
exit(1);
}
printf("\n%-15s %-20s %-10s %-30s\n", "Reg No", "Name", "Gender", "Address");
printf("--------------------------------------------------------------\n");
while (fread(&s, sizeof(struct Student), 1, fp)) {
printf("%-15d %-20s %-10s %-30s\n", s.reg_no, s.name, s.gender, s.address);
}
fclose(fp);
return 0;
}
๐ Explanation:
-
A structure holds registration number, name, gender, and address.
-
A loop collects and writes student data to a file (
score.dat
) until the user decides to stop. -
Once input is complete, the program reopens the file, reads the records, and displays them in a formatted table.