Table of Content

Class 12 Computer Question paper 2080 solution

Class 12 Computer Question Paper 2080 solutions 



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 indicate full marks. 

Time:-2 hrs.                                                                                                                       Full Marks:- 50

Group A

Rewrite the correct options of 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

2. Which of the following techniques is not implemented to protect a database? 
     A) Rollback      B) Backup      C) Recovery      D) Firewall
     Answer: D) Firewall 

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%”; 
 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 
 5. Which of the following is a server-side scripting language? 
     A) JavaScript      B) MySql      C) PHP      D) Jquery 
     Answer: C) PHP 
 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 
 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 
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. 
 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

Group B

Short Answer Questions [5x5=25] 

10. Which type of database system (Centralized or Distributed) is mostly preferred by financial institutions like banks? Give any four suitable reasons. [1+4] 

Answer:

              Financial institutions such as banks generally prefer Distributed Database Systems. Here are four reasons for using a distributed database system. 

a. High availability: Distributed database systems provide high availibility when they continue to function even if some of their components fail. So, this is essential for financial institutions that need to be available 24 hours for their customer. 

b. Scalability: Distributed Database Systems can handle large amounts of data and users, which means these database systems are designed to be scalable. To handle a large volume of transactions, Distributed database system is important for financial institutions such as banks. 

c. Security: Another benefit of distributed database systems is security. It provides greater security than centralized database systems because they distribute data across multiple nodes, which makes it more difficult for hackers to access sensitive information. 

d. Disaster recovery: Distributed database systems have disaster recovery capabilities, which help to recover files quickly from system failures or data loss. And this is important for financial institutions that need to be able to recover quickly in the event of a disaster.

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 

11. Develop a program in JavaScript to exchange/swap the values of any two variables. 

Answer: 

let a = 5; let b = 10;

console.log(`Before swapping: a = ${a}, b = ${b}`);

let temp = a; a = b; b = temp;

console.log(`After swapping: a = ${a}, b = ${b}`);

The above program defines two variables, "a" and "b" and assigns them the values "5", and "10" respectively. Then use the temporary variable 'temp' to swap the value of 'a', and 'b'. Then it logs the values 'a, and 'b' before and after the swap to the console.

Or

How can you connect a databse with PHP? Demostrate with an example. 
Answer: 

                 To connect a database with PHP, we use the mysqli_connect() function, which takes four parameters; the server name, username, password, and database name. Here is an example code:

<?php $servername = "localhost"; $username = "your_username"; $password = "your_password"; $dbname = "your_database_name";

// Create connection $conn = mysqli_connect($servername, $username, $password, $dbname);

// Check connection if (!$conn) {

die("Connection failed: " . mysqli_connect_error());

}

echo "Connected successfully"; ?>


12 Describe the concept of Object Oriented and Procedure Oriented Programming in brief. 
Answer:
             Both Object- Oriented Programming (OOP) and Procedure-oriented programming (OOP) are two programming paradigms, which have different approaches to software design and development. Object-oriented programming (OOP) is programming that is based on the concept of an object. Object contains data and the function that operate on that data. OOP is suitable for developing larger applications, where code reusability and maintainability are essential. OOP carries different features such as encapsulation, inheritance, and polymorphism, which makes it easy to reuse code, hide the implementation details, and build a large application. OOP is widely used in programming languages including Java, Python, C++, and many others programming languages. 
         Procedure Oriented Programming (POP) is programming that is based on or focuses on the execution of functions or procedures that perform specific tasks. In pop, there is little or no emphasis on data abstraction to the function or procedure. It is generally used for developing a smaller application where code reusability is not an important concern. POP is used in procedural languages such as C, Pascal, and Fortran.

13 Write down any five qualities of good software. 
14. Explain mobile computing with its advantages and disadvantages.

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] 
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[20]; int sub1, sub2, sub3;

}; int main() {

struct student students[12]; int i, total; float percentage;

// Input data for 12 students for (i = 0; i < 12; i++) {

printf("Enter roll number, name, sub1 marks, sub2 marks, and sub3 marks of student %d: ", i+1); scanf("%d %s %d %d %d", &students[i].roll_number, students[i].name, &students[i].sub1, &students[i].sub2, &students[i].sub3);

}

// Display data for 12 students printf("\nRoll No.\tName\t\tSub1\tSub2\tSub3\tTotal\tPercentage\n"); for (i = 0; i < 12; i++) {

total = students[i].sub1 + students[i].sub2 + students[i].sub3; percentage = (float)total / 3; printf("%d\t\t%s\t\t%d\t%d\t%d\t%d\t%.2f%%\n", students[i].roll_number, students[i].name, students[i].sub1, students[i].sub2, students[i].sub3, total, 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. 
Answer:

#include <stdio.h> #include <stdlib.h> typedef struct student {

int reg_no; char name[50]; char gender; char address[100];

} student; int main() {

student s; char choice;

// open file for writing FILE *fp = fopen("score.dat", "wb"); if (fp == NULL) {

printf("Error opening file!\n"); exit(1);

} do {

// get student details from user printf("Enter registration number: "); scanf("%d", &s.reg_no); fflush(stdin); // clear input buffer printf("Enter name: "); gets(s.name); printf("Enter gender (M/F): "); scanf("%c", &s.gender); fflush(stdin); // clear input buffer printf("Enter address: "); gets(s.address);

// write student record to file fwrite(&s, sizeof(student), 1, fp);

// ask user if they want to continue printf("Do you want to enter another student record? (Y/N): "); scanf("%c", &choice); fflush(stdin); // clear input buffer

} while (choice == 'Y' || choice == 'y');

// close file fclose(fp);

// open file for reading fp = fopen("score.dat", "rb"); if (fp == NULL) {

printf("Error opening file!\n"); exit(1);

}

// read and display all records printf("\nReg No.\tName\tGender\tAddress\n"); while (fread(&s, sizeof(student), 1, fp)) {

printf("%d\t%s\t%c\t%s\n", s.reg_no, s.name, s.gender, s.address);

}

// close file fclose(fp);

return 0;

} 

  



Post a Comment