NEB Class 12 · Past paper
The complete NEB Class 12 2079 exam paper for Computer Science, all 19 questions with solved model answers.
Tap a question to open its answer.
Which of the following SQL statement is used to DELETE rows from a database table? A) DELETE B) REMOVE C) DROP D) CLEAR
The correct option is A) DELETE. The SQL DELETE statement removes one or more existing rows from a table (optionally restricted with a WHERE clause), for example DELETE FROM student WHERE roll = 5;. REMOVE and CLEAR are not SQL keywords,...
A field that is used to uniquely called: A) Primary Key B) Entity C) Relationship D) Constraints
The correct option is A) Primary Key. A primary key is a field (or set of fields) whose value uniquely identifies each record in a table, and it cannot contain duplicate or null values.
What does "MAC" stands A) Mandatory Access Control B) Media Access Control C) Micro Access Control D) Media Access Certificate
The correct option is B) Media Access Control. The MAC address is a unique hardware address, assigned to the network interface card, that is used at the data link layer to identify a device on a local network.
What is the correct syntax for referring to an external JavaScript script? A) <script src="myscript.js"></script> B) <script href="myscript.js"></script> C) <js href="myscript.js"></js> D) <js src="myscript.js"></js>
The correct option is A) <script src="myscript.js"</script. An external JavaScript file is linked to an HTML page with the <script tag using its src attribute to point to the .js file; href is used for linking stylesheets, not scripts, a...
Which of the following is the correct way of defining a variable in PHP? A) $variable name = value; B) $variable_name = value; C) $variable_name= = value D) $variable name as value;
The correct option is B) $variablename = value;. A PHP variable name must start with a $ sign followed by a letter or underscore, and it cannot contain spaces, so multi word names are written with an underscore, for example
What is the output of C program? void main(){ int b=25; int *p; p=&b; printf("%d %d", &b, p);}
The correct option is B) 1234 1234 (taking the address of b to be 1234, as marked in the question). Since p = &b;, the pointer p is assigned the same address as &b, so printf("%d %d", &b, p) prints the same address value twice.
Which feature of OOP illustrates the code reusability? A) Polymorphism B) Abstraction C) Encapsulation D) Inheritance
The correct option is D) Inheritance. Inheritance lets a new (derived) class reuse the data members and methods of an existing (base) class instead of rewriting them, which is exactly what gives object oriented programs their code reusab...
Which of following is the discovering requirement from a user in the requirement collection process? A) Feasibility study B) Requirement Elicitation C) Requirement Specification D) Requirement validation
The correct option is B) Requirement Elicitation. Requirement elicitation is the activity of discovering and gathering the requirements of users and stakeholders, typically through interviews, questionnaires or observation, before those ...
What devices are detecting and responding to changes in an environment that are embedded in smart phones and an integral part of the Internet of Things (IoT)? A) Wi-Fi B) Barcode C) RFID D) Sensors
The correct option is D) Sensors. Sensors are the devices embedded in smart objects such as smart phones that detect changes in their environment (light, temperature, motion and so on) and send this data over a network, which is the basi...
Differentiate the centralized and distributed database system.
A centralized database stores all of an organization's data at a single physical location and is managed by a single central server, whereas a distributed database stores data across multiple physical locations or computers that are conn...
What are the purposes of normalization ? Give an example of 2NF.
Normalization is the process of organizing the fields and tables of a relational database so as to reduce data redundancy and avoid update, insertion and deletion anomalies. Its main purposes are to eliminate duplicate data, to ensure that related data is stored logically together, to keep the database consistent when data is changed, and to make the database structure easier to maintain and extend.
Example of Second Normal Form (2NF): a table is in 2NF when it is already in 1NF and every non key attribute depends on the whole primary key, not just part of it. Consider a table with a composite key (StudentID, CourseID):
| StudentID | CourseID | StudentName | CourseName |
|---|---|---|---|
| 1 | C1 | Ram | C Programming |
| 1 | C2 | Ram | Database |
Here StudentName depends only on StudentID (not on the whole key), which is a partial dependency and violates 2NF. To achieve 2NF, the table is split into:
Student(StudentID, StudentName) and Enrollment(StudentID, CourseID, CourseName)
so that every non key column now depends on the full primary key of its own table.
Write a program to find the factorial of any number using Javascript.
The factorial of a number n is the product of all positive integers up to n, which can be computed with a simple for loop that multiplies a running total. The variable fact starts at 1 and the loop multiplies it by every integer from 1 u...
How do you fetch data from a database in PHP and display it in form ? Describe.
Data is fetched from a MySQL database in PHP by first connecting to the database with mysqliconnect(), running a SELECT query with mysqliquery(), and then looping over the returned result set with mysqlifetchassoc() to display each row. ...
Compare the OOPs and procedural programing language.
Object oriented programming (OOP) and procedural programming are two different approaches to organizing program logic. Basis Procedural programming Object oriented programming --------- Basic unit Function/procedure Object (data + method...
What are the major activities performed to design the software ? Describe.
Software design is the phase of the SDLC where the requirements gathered earlier are turned into a blueprint for construction. Its major activities are:
Carrying out these activities carefully before coding begins helps ensure that the final software meets the requirements, is easy to build, and is easy to test and maintain afterward.
Explain the popular five-application areas of AI.
Artificial Intelligence (AI) is applied across many fields today. Five popular application areas are: - Healthcare, where AI is used for disease diagnosis from medical images, drug discovery and predicting patient risk. - Robotics, where...
Compare the star and ring topology with pros and cons. Which of data communication cable is more appropriate to design the local area network ? Describe.
In a star topology, every computer is connected individually to a central device (a hub or switch), so all data passes through that central point. In a ring topology, every computer is connected to exactly two neighboring computers, form...
What is structure ? Write a program to input roll, name and age of 5 students and display them properly using structure.
A structure in C is a user defined data type that groups together variables of different data types under a single name, so that related information (such as a student's roll number, name and age) can be handled as one unit.
#include <stdio.h>
struct Student {
int roll;
char name[30];
int age;
};
int main() {
struct Student s[5];
int i;
for (i = 0; i < 5; i++) {
printf("Enter roll, name and age of student %d: ", i + 1);
scanf("%d %s %d", &s[i].roll, s[i].name, &s[i].age);
}
printf("\nRoll\tName\tAge\n");
for (i = 0; i < 5; i++)
printf("%d\t%s\t%d\n", s[i].roll, s[i].name, s[i].age);
return 0;
}
The structure Student bundles roll, name and age together, and the array s[5] holds five such records. The first loop reads each student's data into s[i].roll, s[i].name and s[i].age, and the second loop prints those same fields for all five students in a tabular form.
Write a C program to enter ID, employee_name, and post of the employee and store them in a data file named "emp.txt". Display each record on the screen in an appropriate format.
Each employee's ID, name and post can be grouped into a structure, written to the text file emp.txt with fprintf(), and then read back and displayed with fscanf(). The file emp.txt is opened in write mode and each entered record is appen...
Which of the following is the correct way of defining a variable in PHP? A) variable_name = value; C) variable name as value;
The correct option is B) sign followed by a letter or underscore, and it cannot contain spaces, so multi word names are written with an underscore, for example