Class 12 Computer Model Question Solution with Free PDF 2080
NEB -XII Model Question 2080(2023) Computer Science Solution PDF
Note: PDF Download Button is provided at the end of this article. This is completely free PDF, so you can download and read class 12 computer model question from your without needing the internet.
Candidates are required to give their answer in their own words as far as practicable. The figures in the
margin indicate full marks.
Time:-2 hrs.
Full Marks:- 50
Group A
Rewrite the correct options of each questions 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: C) First
Explanation: Atomicity is introduced in the first normal form (1NF) but it is not specific to 1NF only.
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: Firewall is not a technique to protect a database. It is a security system that is designed to prevent unauthorized access to or from a private network. The other three techniques are commonly implemented to protect a database: Rollback, Backup, and Recovery.
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 "_" wildcard character is used in SQL to match any single character. So the WHERE clause "LNAME LIKE “_A%”" means that the second character of LNAME must be "A". The percent "%" wildcard character is used to match zero or more characters. Therefore, this command will display all the records that have a second letter in the LNAME as "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: An IP address is a unique numerical identifier that is assigned to each device connected to the internet. An IP address is typically represented as four decimal numbers separated by dots. Each number can range from 0 to 255. An IP address with only three numbers separated by dots is not a valid IP address. Therefore, 192.168.1 is an incorrect IP address.
5. Which of the following is a server-side scripting language?
A) JavaScript B) MySql C) PHP D) Jquery
Answer: C) PHP
Explanation: A server-side scripting language is a programming language that is used to generate dynamic web pages. The code is executed on the web server, and the resulting HTML is sent to the user's web browser. PHP is a popular server-side scripting language that is widely used for web development.
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: In JavaScript, variables can be declared using the "var" or "let" keyword. The "var" keyword is used to declare variables that have function scope, while the "let" keyword is used to declare variables that have block scope.
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 period "." operator is used to concatenate strings. Therefore, the correct command to concatenate the variables $x with $y is $x.$y.
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: B) Data is hidden and cannot be accessed.
Explanation: This statement is incorrect. In object-oriented programming (OOP), data can be hidden and protected by encapsulation, but it can also be accessed through methods or properties that are exposed by the object. OOP emphasizes data and procedures equally, and it supports both abstract data and classes.
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 is concerned with determining the cost-effectiveness of a project. It involves analyzing the costs and benefits of the project, and determining whether the benefits outweighs.
Group B
Short Answer Questions [5x5=25]
10. Which type of database system (centralized or distributed) is mostly preferred by financial institution like a bank? Give any four suitable reasons. [1+4]
Financial institutions like banks usually prefer a centralized database system rather than a distributed one. Here are four suitable reasons for this preference:
Data Consistency: A centralized database system ensures that all data is stored in one central location, which makes it easier to maintain consistency across the data. This is particularly important for financial institutions like banks, where accuracy and consistency of data are critical.
Security: Centralized database systems can be easier to secure than distributed systems. A centralized system can have a single point of entry that can be more easily monitored and protected. Security measures can be implemented more effectively, reducing the risk of data breaches.
Scalability: Centralized database systems can be more easily scaled up as needed. Adding more storage capacity or processing power to a centralized system is usually simpler and less expensive than doing the same for a distributed system.
Efficiency: Centralized database systems can be more efficient in terms of processing transactions. Transactions can be processed faster when all data is stored in one central location. This is important for financial institutions like banks, where a delay in processing transactions can lead to significant financial losses.
Overall, a centralized database system is the preferred choice for financial institutions like banks, as it offers greater data consistency, security, scalability, and efficiency.
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. 5
The relational model for database design has gained widespread popularity in recent years, and for good reason. Here are five arguments that justify why most business organizations prefer applying the relational model over other models.
Simplicity: The relational model is a simple and intuitive approach to database design. It is easy to understand and implement, making it accessible to both technical and non-technical users. This simplicity also leads to lower development and maintenance costs.
Flexibility: The relational model is a flexible approach to database design, allowing for the addition or removal of data without significant changes to the overall structure. This is particularly useful in business organizations where the data requirements may change frequently.
Data Integrity: The relational model enforces strict rules for data integrity, preventing inconsistencies and errors in the database. This is essential for business organizations where data accuracy and consistency are critical.
Scalability: The relational model is highly scalable, allowing for the addition of more data and users as needed. This makes it ideal for large and growing organizations with ever-increasing data requirements.
Compatibility: The relational model is widely adopted and supported by most database management systems (DBMS), making it easy to integrate with other software applications. This compatibility allows for seamless integration with other business tools and technologies, increasing efficiency and productivity.
Overall, the simplicity, flexibility, data integrity, scalability, and compatibility of the relational model make it the preferred choice for most business organizations when it comes to database design.
11. Develop a program in JavaScript to exchange/swap the values of any two variables. 5
<script>
// initialize two variables
let a = 5;
let b = 7;
// display the original values
console.log("Original values:");
console.log("a = " + a);
console.log("b = " + b);
// swap the values using a temporary variable
let temp = a;
a = b;
b = temp;
// display the swapped values
console.log("Swapped values:");
console.log("a = " + a);
console.log("b = " + b);
OR
How can you connect a database with PHP? Demonstrate with an example. 5
<?php
// Database configuration
$servername = "localhost";
$username = "root";
$password = "12345678";
$dbname = "example_db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
// Close connection
$conn->close();
?>
12. Describe the concept of Object Oriented and Procedure Oriented Programming in brief. 2+3
Object-Oriented Programming (OOP) and Procedure-Oriented Programming (POP) are two programming styles used to write computer programs.
In OOP, programs are organized around objects that interact with each other to perform a task, while in POP, programs are organized around a sequence of procedures or functions executed one after the other.
OOP emphasizes the use of objects and encapsulation to organize and manipulate data, while POP emphasizes the use of functions and data structures.
OOP provides a more structured and modular approach to programming, making it easier to maintain and extend the codebase, while POP is simpler and more straightforward, making it easier to learn and understand for beginners.
Both programming styles have their own benefits and drawbacks, and the choice between them depends on the specific requirements of the program and the preferences of the programmer.
13. Write down any five qualities of good software. 5
Software is a collection of computer programs, data, and associated documentation that performs specific tasks or functions. Good software is software that meets the needs and requirements of its users, performs its intended functions accurately and efficiently, is reliable and easy to maintain, and provides an intuitive and user-friendly interface.
There are several qualities of good software, including:
Functionality: Good software should meet the requirements of the user and perform the intended functions accurately and efficiently.
Reliability: Good software should be reliable and operate without failure or errors under normal conditions, as well as recover quickly from any errors that occur.
Maintainability: Good software should be easy to maintain, modify, and extend as needed over time, without causing unintended side effects or breaking existing functionality.
Usability: Good software should be easy to use, with an intuitive and user-friendly interface that requires minimal training or documentation.
Efficiency: Good software should use system resources efficiently and perform tasks quickly, without wasting unnecessary time or using excessive memory or CPU resources.
Other qualities of good software may include security, scalability, portability, and compatibility, depending on the specific requirements and context of the software.
14. Explain mobile computing with its advantages and disadvantages. 5
Mobile computing refers to the use of portable computing devices, such as smartphones, tablets, laptops, and wearables, to access and process information while on the move. Mobile computing has become increasingly popular in recent years due to its convenience and flexibility, and it has revolutionized the way people work, communicate, and interact with technology.
Advantages of mobile computing:
Portability: Mobile devices are portable and can be carried around easily, allowing users to access information and applications from anywhere, at any time.
Flexibility: Mobile computing allows users to work or communicate while on the move, providing greater flexibility and convenience.
Connectivity: Mobile devices can be connected to the internet or other networks, allowing users to access and share information and resources with others.
Efficiency: Mobile computing can improve productivity and efficiency by enabling users to perform tasks more quickly and easily.
Entertainment: Mobile devices can be used for entertainment purposes, such as playing games, watching videos, or listening to music.
Disadvantages of mobile computing:
Security: Mobile devices are more vulnerable to security threats, such as hacking or malware attacks, due to their portability and connectivity.
Battery life: Mobile devices have limited battery life and may require frequent charging, which can be inconvenient.
Small screen size: Mobile devices have smaller screens compared to desktop computers or laptops, which can make it harder to view and edit documents or perform other tasks.
Limited processing power: Mobile devices may have limited processing power, memory, and storage capacity, which can restrict the types of tasks that can be performed.
Distraction: Mobile devices can be a source of distraction, such as notifications or social media, which can affect productivity and concentration.
Overall, mobile computing has many advantages and disadvantages, and its suitability depends on the specific needs and context of the user.
Group C (Long Answer Questions)
Give the long answers to the following questions. [2x8=16]
15. Why do most of the business organizations prefer setting their network with the client-server architecture? Write its advantages and disadvantages. [2+6]
Most business organizations prefer setting their network with a client-server architecture because it allows for centralized management and control of network resources, as well as providing a scalable and efficient solution for accessing and sharing data and applications across multiple devices and locations.
Advantages of client-server architecture:
Centralized management: The client-server architecture allows for centralized management and control of network resources, such as data storage, security, and backup.
Scalability: The client-server architecture is scalable, allowing for additional clients to be added to the network as needed.
Efficiency: The client-server architecture is efficient, allowing for fast and reliable access to data and applications across the network.
Security: The client-server architecture provides a higher level of security, with sensitive data and applications stored and managed centrally, rather than being distributed across individual devices.
Reliability: The client-server architecture is reliable, with network resources and applications available and accessible to clients at all times.
Disadvantages of client-server architecture:
Complexity: The client-server architecture can be complex to set up and maintain, requiring specialized knowledge and skills.
Cost: The client-server architecture can be expensive to set up and maintain, requiring the purchase and maintenance of dedicated server hardware and software.
Network dependency: The client-server architecture is dependent on network connectivity, with network downtime or slow connectivity affecting the availability and performance of network resources and applications.
Single point of failure: The client-server architecture is vulnerable to a single point of failure, with network resources and applications being inaccessible if the server fails.
Limited mobility: The client-server architecture can be limiting for mobile users, who may require additional security and connectivity measures to access network resources and applications outside of the network.
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].
#include <stdio.h>
int main() {
struct student {
int roll_number;
char name[50];
int sub1_marks;
int sub2_marks;
int sub3_marks;
float total;
float percentage;
};
struct student stud[12];
int i;
printf("Enter information of 12 students:\n");
for (i = 0; i < 12; i++) {
printf("Enter roll number: ");
scanf("%d", &stud[i].roll_number);
printf("Enter name: ");
scanf("%s", &stud[i].name);
printf("Enter marks scored in sub1 (out of 100): ");
scanf("%d", &stud[i].sub1_marks);
printf("Enter marks scored in sub2 (out of 100): ");
scanf("%d", &stud[i].sub2_marks);
printf("Enter marks scored in sub3 (out of 100): ");
scanf("%d", &stud[i].sub3_marks);
stud[i].total = stud[i].sub1_marks + stud[i].sub2_marks + stud[i].sub3_marks;
stud[i].percentage = stud[i].total / 3;
}
printf("\nStudent details:\n\n");
printf("Roll No.\tName\tSub1\tSub2\tSub3\tTotal\tPercentage\n");
for (i = 0; i < 12; i++) {
printf("%d\t\t%s\t%d\t%d\t%d\t%.2f\t%.2f%%\n", stud[i].roll_number, stud[i].name,
stud[i].sub1_marks, stud[i].sub2_marks, stud[i].sub3_marks, stud[i].total, stud[i].percentage);
}
return 0;
}
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.
#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 creating file!\n");
exit(1);
}
do {
printf("Enter registration number: ");
scanf("%d", &s.reg_no);
printf("Enter name: ");
scanf("%s", s.name);
printf("Enter gender: ");
scanf("%s", s.gender);
printf("Enter address: ");
scanf("%s", s.address);
fwrite(&s, sizeof(struct student), 1, fp);
printf("Do you want to continue? (y/n): ");
scanf(" %c", &choice);
} while (choice == 'y');
fclose(fp);
fp = fopen("score.dat", "rb");
if (fp == NULL) {
printf("Error opening file!\n");
exit(1);
}
printf("\n%-15s %-20s %-10s %-40s\n", "Registration", "Name", "Gender", "Address");
printf("-----------------------------------------------------------------------\n");
while (fread(&s, sizeof(struct student), 1, fp)) {
printf("%-15d %-20s %-10s %-40s\n", s.reg_no, s.name, s.gender, s.address);
}
fclose(fp);
return 0;
}
Explanation of the code :
- The code begins with two include statements, which import the standard input/output and standard library header files, respectively.
- The code defines a new structure called "student" that contains four fields: reg_no (an integer), name (a string), gender (a string), and address (a string).
- The main function begins by creating a new student struct called "s". It also creates a file pointer called "fp" that will be used to write to and read from the file.
- The code attempts to open a file called "score.dat" for writing in binary mode using the "wb" mode string. If the file cannot be opened, the code prints an error message and exits the program.
- The program enters a do-while loop that prompts the user to enter information about a student, stores that information in the "s" struct, and then writes the struct to the file using the fwrite function.
- After each write to the file, the program prompts the user whether they want to continue entering more student information. If the user enters 'y', the program continues to prompt for student information; otherwise, the loop exits.
- Once the user is finished entering student information, the program closes the file.
- The program then attempts to reopen the "score.dat" file for reading in binary mode using the "rb" mode string. If the file cannot be opened, the program prints an error message and exits the program.
- The program prints a header line for the table of student data that will be displayed.
- The program enters a while loop that reads each struct from the file using the fread function and prints the data in a formatted table.
- Finally, the program closes the file and returns 0 to indicate successful completion.
Comments
Post a Comment