Class 12 New NEB question Pattern

                                                                                       Sub. code: 4281
                                                NEB -XII
                                            Model Question
                                               2079(2023)
                                          Computer Science
Candidates are required to give their answers in their own words as far as practicable. The figures in the
margin indicates full marks.
Time:-2 hrs.                                                         Full Marks:- 50
                                                                                         (9x1=9)
                                  Group A
Rewrite the correct options for each question in your answer sheet.
1. In which normal form of database, atomicity is introduced?
A) First      B) Second C) Third                       D) Fourth
2. Which of the following techniques is not implemented to protect a database?
    A) Rollback B) Backup C) Recovery D) Firewall
3. Which one of the following SQL commands are 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 NAME 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";
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
5. Which of the following is a server-side scripting language?
A) JavaScript B) MySql  C) PHP    D) Jquery
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
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
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.
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
                        Group B
Short Answer Questions                                                                 [5x5=25]
10. Which type of database system (centralized or distributed) is mostly preferred by the financial institution
like a bank? Give any four suitable reasons.                                                     [1+4]
                                                     OR
Nowadays most business organizations prefer applying a relational model for database design
in comparison to other models. Justify the statement with your arguments.                        5
11. Develop a program in JavaScript to exchange/swap the values of any two variables.            5
                                              OR
How can you connect a database with PHP? Demonstrate with an example.                            5
12. Describe the concept of Object Oriented and Procedure Oriented Programming in brief.         2+3
13. Write down any five qualities of good software.                                              5
14. Explain mobile computing with its advantages and disadvantages.                              5
                                           Group C (Long Answer Questions)                [2x8=16]
Give the long answers to the following questions.
15. Why do most business organizations prefer setting their network with the client-server
architecture? Write its advantages and disadvantages.                                            [2+6]
16. Develop a program in C using structure to ask for 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].
                                                              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.
                                                              -0-

                                                                        Answers
1. The answer is C. Third normal form (3NF) is a database normalization form that eliminates all redundant data from a database table. In 3NF, each non-prime attribute (an attribute that is not a primary key) must depend on the entire primary key of the table.

2. The answer is B. A firewall is a network security device that monitors and filters incoming and outgoing network traffic based on predetermined security rules. It is not a technique used to protect a database.

3. The answer is C. The SQL command SELECT * FROM CUSTOMER WHERE LNAME LIKE "A%" will display all the records having a second letter in the LNAME (LAST NAME) as "A" from the customer table. The LIKE operator is used to search for a pattern in a column. The % character is a wildcard that can match any number of characters.

4. The answer is B. The IP address 192.168.1 is not in the correct format. An IP address is a 32-bit number that is written in four parts, separated by periods. Each part can be a number from 0 to 255.

5. The answer is C. PHP is a server-side scripting language that is used to create dynamic web pages.

6. The answer is C. The keywords var and let are used to declare variables in JavaScript.

7. The answer is D. The PHP command $x.$y is used to concatenate the variables $x and $y.

8. The answer is D. Object-oriented programming supports abstract data and classes.

9. The answer is B. Economic feasibility is a feasibility study that is concerned with the cost and benefits of a project. It is used to determine whether the project is worth pursuing.

10 Ans: Financial institutions like banks prefer centralized database systems for several reasons. These include:

Security: Centralized databases are easier to secure than distributed databases. This is because all of the data is stored in a single location, making it easier to monitor and protect.

Performance: Centralized databases are typically faster than distributed databases. This is because all of the data is stored on a single server, which can access more quickly.

Scalability: Centralized databases are easier to scale than distributed databases. This is because they can be expanded by simply adding more servers to the network.

Cost: Centralized databases are typically less expensive than distributed databases. This is because they require less hardware and software.

In addition to these reasons, centralized databases are also more compatible with existing systems and applications. This can make it easier to implement a centralized database system in an existing financial institution.

Here are some additional details about each of the reasons listed above:

Security: Centralized databases are easier to secure than distributed databases because all of the data is stored in a single location. This makes it easier to monitor and protect the data from unauthorized access, modification, or destruction.

Performance: Centralized databases are typically faster than distributed databases because all of the data is stored on a single server. This means that the server does not have to communicate with multiple other servers to access the data, which can significantly improve performance.

Scalability: Centralized databases are easier to scale than distributed databases because they can be expanded by simply adding more servers to the network. This makes it easier to meet the growing demands of a financial institution as it expands its operations.

Cost: Centralized databases are typically less expensive than distributed databases because they require less hardware and software. This is because a centralized database only needs a single server, whereas a distributed database requires multiple servers.

Overall, there are several reasons why financial institutions prefer centralized database systems. These systems offer several advantages over distributed databases, including improved security, performance, scalability, and cost.

Or
Ans: Sure, here are some of the reasons why relational databases are preferred over other models:
Simplicity: Relational databases are relatively simple to understand and use. This is because they are based on a simple concept of tables, rows, and columns.

Flexibility: Relational databases are very flexible. They can be used to store a wide variety of data types, and they can be easily modified to accommodate changes in data requirements.

Efficiency: Relational databases are very efficient at storing and retrieving data. This is because they use a technique called normalization, which helps to reduce data redundancy and improve performance.

Security: Relational databases can be secured using a variety of techniques, such as user-defined roles, permissions, and encryption.

Scalability: Relational databases can be scaled up to handle large amounts of data. This is because they can be distributed across multiple servers.

Overall, relational databases offer several advantages over other database models. This is why they are the most popular type of database for business organizations.

Here are some additional details about each of the reasons listed above:

Simplicity: Relational databases are relatively simple to understand and use. This is because they are based on a simple concept of tables, rows, and columns. For example, a table might represent a customer, with columns for the customer's name, address, and phone number. A row would represent a single customer.

Flexibility: Relational databases are very flexible. They can be used to store a wide variety of data types, including text, numbers, dates, and images. They can also be easily modified to accommodate changes in data requirements. For example, if a new field is needed for a customer table, it can be added without affecting the rest of the database.

Efficiency: Relational databases are very efficient at storing and retrieving data. This is because they use a technique called normalization, which helps to reduce data redundancy and improve performance. Normalization is a process of dividing a database into smaller tables, each of which contains only one type of data. This makes it easier to find and update data, and it also helps to improve performance.

Security: Relational databases can be secured using a variety of techniques, such as user-defined roles, permissions, and encryption. User-defined roles allow you to create different levels of access for different users. For example, you might create a role for sales representatives that allows them to view and update customer data, but not to create new customers. Permissions allow you to control what users can do with specific data. For example, you might grant a user permission to view customer data, but not to modify it. Encryption can be used to protect sensitive data, such as credit card numbers.

Scalability: Relational databases can be scaled up to handle large amounts of data. This is because they can be distributed across multiple servers. For example, a large retailer might have one database server for each region. This allows the retailer to store all of its customer data in a single database, while still maintaining good performance.

Overall, relational databases offer several advantages over other database models. This is why they are the most popular type of database for business organizations.

11 Ans: Sure, here is a program in JavaScript to exchange/swap the values of any two variables:
function swap(a, b) {
// Temporary variable to store the value of a
const temp = a;
// Assign the value of b to a
a = b;
// Assign the value of temp (which is the original value of a) to b
b = temp;
// Return the values of a and b
return [a, b];
}

This program uses a temporary variable to store the value of a before assigning the value of b to a. Then, it assigns the value of the temporary variable (which is the original value of a) to b. Finally, it returns the values of a and b.

Here is an example of how to use the swap() function:

const a = 10;
const b = 20;
const [c, d] = swap(a, b);
console.log(c, d); // 20, 10

As you can see, the swap() function has successfully exchanged the values of variables a and b.

Or
Ans :
Sure, here is an example of how to connect a database with PHP:
<?php
// Create a new PDO object
$pdo = new PDO('mysql:host=localhost;dbname=mydb', 'username', 'password');
// Set the PDO error mode to exception
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Try to connect to the database
try {
// Run a query
$results = $pdo->query('SELECT * FROM users');
// Check if the query was successful
if ($results) {
// Loop through the results
foreach ($results as $row) {
// Print the row
echo $row['name'] . ' ' . $row['email'] . '<br>';
}
}
} catch (PDOException $e) {
// Print the error message
echo $e->getMessage();
}
?>
This code will connect to a MySQL database named mydb on the local host. It will then run a query to select all rows from the users table. If the query is successful, it will loop through the results and print the name and email address of each user. If the query is not successful, it will print the error message.

12. Ans: Sure. Object-oriented programming (OOP) and procedural programming are two different programming paradigms. OOP is a programming paradigm that treats data as objects, which are entities that have both data and methods associated with them. Procedural programming, on the other hand, is a programming paradigm that treats code as a series of instructions that are executed one after the other.

Here are some of the key differences between OOP and procedural programming:

Data: In OOP, data is organized into objects. An object is a data structure that contains both data and methods. Methods are functions that are associated with an object and can be used to manipulate the object's data. In procedural programming, data is not organized into objects. Instead, data is stored in variables and functions are used to manipulate the data.

Code: In OOP, code is organized into classes. A class is a blueprint for creating objects. Classes contain both data and methods. In procedural programming, code is not organized into classes. Instead, code is organized into functions.

Encapsulation: In OOP, data is encapsulated. This means that data is hidden from other objects. Only the object that owns the data can access it. In procedural programming, data is not encapsulated. This means that data is accessible to all objects.

Inheritance: In OOP, objects can inherit from other objects. This means that an object can reuse the code and data of another object. In procedural programming, objects cannot inherit from other objects.
Polymorphism: In OOP, objects can be polymorphic. This means an object can be used in place of another object, even if the two objects have different data types. In procedural programming, objects cannot be polymorphic.
Which programming paradigm is better? This depends on the specific application. OOP is often better for applications that are complex or require a lot of data manipulation. Procedural programming is often better for applications that are simple or require a lot of speed.

13. Ans: Sure, here are five qualities of good software:

Usability: Good software is easy to use. It has a clear and concise user interface that is easy to understand and navigate.

Efficiency: Good software is efficient. It uses the available resources (such as memory and processing power) effectively.

Reliability: Good software is reliable. It works as expected and does not crash or produce errors.

Security: Good software is secure. It protects user data from unauthorized access, modification, or destruction.

Maintainability: Good software is maintainable. It is easy to modify and update.

These are just a few of the qualities that make for good software. Other qualities that may be important include performance, scalability, and portability.

14. Ans: Mobile computing is the use of portable devices to access and process information. Mobile devices include smartphones, tablets, laptops, and wearables. Mobile computing has many advantages, including:

Portability: Mobile devices are portable, so they can be used anywhere. This makes them ideal for people who need to be able to access information and work on the go.

Connectivity: Mobile devices are always connected to the internet, so users can access information and services anywhere. This makes them ideal for staying connected with friends and family, checking work emails, and doing research.

Affordability: Mobile devices are becoming more affordable, making them accessible to a wider range of people.

Ease of use: Mobile devices are easy to use, even for people who are not familiar with computers. This makes them ideal for people of all ages and skill levels.

However, mobile computing also has some disadvantages, including:

Battery life: Mobile devices have limited battery life, so they need to be charged regularly. This can be a problem if you are using your device heavily and do not have access to a charger.

Security: Mobile devices are more susceptible to security threats than traditional computers. This is because they are often connected to the internet and have fewer security features.

Distraction: Mobile devices can be a distraction. If you are not careful, you can easily get caught up in using your device and lose track of time.

Eye strain: Using mobile devices for extended periods can cause eye strain. This is because the screens on mobile devices are often smaller and brighter than traditional computer screens.

Overall, mobile computing has many advantages and disadvantages. It is important to weigh the pros and cons before deciding whether or not to use a mobile device for a particular task.

15. Ans: A client-server network is a type of network architecture in which the client computers request resources from the server computers. The server computers then process the requests and return the results to the client computers.

There are many advantages to using a client-server network for business organizations. Some of the most notable advantages include:

Centralized data storage and management: All of the data for the organization is stored on the server computers. This makes it easy to manage and secure the data.

Improved security: The server computers can be configured to restrict access to certain data or resources. This helps to protect the organization's data from unauthorized access.

Increased efficiency: Client-server networks can be more efficient than other types of networks, such as peer-to-peer networks. This is because the server computers can handle the processing of requests, freeing up the client computers to focus on other tasks.

Scalability: Client-server networks are scalable, meaning that they can be easily expanded to accommodate more users or more data.

However, there are also some disadvantages to using a client-server network. Some of the most notable disadvantages include:

Cost: Client-server networks can be more expensive to set up and maintain than other types of networks.

Complexity: Client-server networks can be more complex to set up and manage than other types of networks.

Single point of failure: If the server computers fail, the entire network will be unavailable.
Overall, client-server networks offer several advantages for business organizations. However, it is important to weigh the advantages and disadvantages carefully before deciding whether or not to use a client-server network.

Here are some additional details about the advantages and disadvantages of client-server networks:

Advantages:
Centralized data storage and management: This makes it easy to manage and secure the data.
Improved security: The server computers can be configured to restrict access to certain data or resources. This helps to protect the organization's data from unauthorized access.

Increased efficiency: Client-server networks can be more efficient than other types of networks, such as peer-to-peer networks. This is because the server computers can handle the processing of requests, freeing up the client computers to focus on other tasks.

Scalability: Client-server networks are scalable, meaning that they can be easily expanded to accommodate more users or more data.

Disadvantages:
Cost: Client-server networks can be more expensive to set up and maintain than other types of networks.

Complexity: Client-server networks can be more complex to set up and manage than other types of networks.

Single point of failure: If the server computers fail, the entire network will be unavailable.
In conclusion, client-server networks offer several advantages for business organizations. However, it is important to weigh the advantages and disadvantages carefully before deciding whether or not to use a client-server network.

16. Ans: Sure, here is the C program using structure to ask for the information of any 12 students with roll_number, name, and marks scored in sub1, sub2, and sub3. It also displays them in proper format along with the calculation of total and percentage. 

#include <stdio.h>
struct student {
int roll_number;
char name[50];
int marks[3];
};
int main() {
struct student s[12];
int i, total, percentage;
for (i = 0; i < 12; i++) {
printf("Enter the roll number of student %d: ", i + 1);
scanf("%d", &s[i].roll_number);
printf("Enter the name of student %d: ", i + 1);
scanf("%s", s[i].name);
for (int j = 0; j < 3; j++) {
printf("Enter the marks of student %d in subject %d: ", i + 1, j + 1);
scanf("%d", &s[i].marks[j]);
}
}
for (i = 0; i < 12; i++) {
total = 0;
for (int j = 0; j < 3; j++) {
total += s[i].marks[j];
}
percentage = (total / 300) * 100;
printf("Roll number: %d\n", s[i].roll_number);
printf("Name: %s\n", s[i].name);
printf("Marks in subject 1: %d\n", s[i].marks[0]);
printf("Marks in subject 2: %d\n", s[i].marks[1]);
printf("Marks in subject 3: %d\n", s[i].marks[2]);
printf("Total marks: %d\n", total);
printf("Percentage: %d%%\n\n", percentage);
}
return 0;
}

This program will ask the user to enter the information of 12 students, including their roll number, name, and marks in three subjects. The program will then display the information in a table format, along with the total marks and percentage for each student.

17. Ans: Sure, here is the C program to create a data file named score.dat to store students' information with Reg_no, name, gender, and address. The program asks the user to continue or not. When finished, the program also displays all the records in the proper format.

#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *fp;
char ch;
struct student {
int reg_no;
char name[50];
char gender[10];
char address[100];
};
struct student s[10];
int i, count = 0;
fp = fopen("score.dat", "w");
if (fp == NULL) {
printf("Error opening file\n");
exit(1);
}
do {
printf("Enter student details:\n");
printf("Reg_no: ");
scanf("%d", &s[count].reg_no);
printf("Name: ");
scanf("%s", s[count].name);
printf("Gender: ");
scanf("%s", s[count].gender);
printf("Address: ");
scanf("%s", s[count].address);
count++;
printf("Do you want to continue? (Y/N): ");
fflush(stdin);
scanf("%c", &ch);
} while (ch == 'Y' || ch == 'y');
fclose(fp);
fp = fopen("score.dat", "r");
if (fp == NULL) {
printf("Error opening file\n");
exit(1);
}
printf("The records are:\n");
for (i = 0; i < count; i++) {
fscanf(fp, "%d %s %s %s", &s[i].reg_no, s[i].name, s[i].gender, s[i].address);
printf("Reg_no: %d\n", s[i].reg_no);
printf("Name: %s\n", s[i].name);
printf("Gender: %s\n", s[i].gender);
printf("Address: %s\n\n", s[i].address);
}
fclose(fp);
return 0;
}

This program will ask the user to enter the information of 10 students, including their Reg_no, name, gender, and address. The program will then create a data file named score.dat and store the information in the file. The program will then display the information in the file.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.