NEB Class 12 · Past paper
The complete NEB Class 12 2080 exam paper for Computer Science, all 19 questions with solved model answers.
Tap a question to open its answer.
Which of the given sign is used as a shortcut for JQuery ? A) the % sign B) the & sign C) the $ sign D) the @ sign
The correct option is C) the $ sign. jQuery defines $ as a shorthand alias for the jQuery function/object, so
Which of the following is DML statement ? A) Create B) Select C) Create view Alter D) Drop
The correct option is B) Select. SELECT retrieves and manipulates data stored in a table, which makes it a Data Manipulation Language (DML) command, whereas CREATE, ALTER and DROP define or change the structure of database objects and be...
A collection of hyperlinked documents on the Internet is called : A) HTML B) webpage C) www D) email system
The correct option is C) www (World Wide Web). The World Wide Web is the system of interlinked hypertext documents (webpages) that can be accessed over the internet; HTML is only the markup language used to write a single webpage, not th...
Which of following IPV4 address valid ? A) 192.168.1.1 B) EEE.000.33.000 C) 257.2.5.1 D) 202.70.71.262
The correct option is A) 192.168.1.1. A valid IPv4 address has four decimal numbers, each between 0 and 255, separated by dots; option B uses letters instead of numbers, while options C (257) and D (262) both contain an octet greater tha...
Which jQuery method is used to hide selected elements ? A) hide ( ) B) hide (on) C) invisible ( ) D) display (none)
The correct option is A) hide(). The jQuery hide() method hides the matched elements, for example
Which function is used to connect to mySQL database ? A) mySqLi_open ( ) B) mySqLi_connect ( ) C) var mySqLi_query ( ) D) $mySqLi_con ( )
The correct option is B) mysqliconnect(). In PHP, mysqliconnect(server, username, password, database) opens a connection to a MySQL database server; mysqliopen() and
Which of the following is true about FILE *fpt ? A) FILE is a keyword in c for representing files and fpt is a variable of FILE type B) FILE is a buffered Stream C) FILE is a Stream D) FILE is a structure and fpt is a pointer to the structure of FILE type.
The correct option is D. In C, FILE is actually a structure type (defined in stdio.h) that holds information about an open file such as its position and buffer, and a file pointer such as fpt is declared as FILE fpt to point to (that is,...
Which a SDLC phase is used to ensure quality software ? A) implementation B) maintenance C) testing D) system study
The correct option is C) testing. The testing phase of the SDLC checks the developed software against the requirements to find and fix defects, which is what ensures the delivered software is of acceptable quality before it is implemented.
Coaxial cable is an example of ... A) Communication software B) Guided Transmission media C) Unguided Transmission media D) All of them
The correct option is B) Guided Transmission media. Coaxial cable is a physical, wired medium along which signals travel in a guided (bound) path, unlike unguided media such as radio waves which travel through free space.
Explain the Relational Data model with example.
The relational data model organizes data into two dimensional tables, called relations, where each table consists of rows (tuples) and columns (attributes). Every table has a set of column names describing what each attribute stores, and...
Write SQL DDL commands to execute the following task with reference to the schema given below : student_info (regno as integer, name as character(25), class integer, gender character(1), address character(25)).
The Data Definition Language (DDL) command used to create a new table matching a given schema is CREATE TABLE, which names the table and lists each column with its data type. This statement creates the table studentinfo with five columns...
Define a syntax for database connectivity. Write a server side scripting code to insert data into the table student having fields (first name, last name, mark and email :) Assume that server name ="localhost", username ="root", password =" ", database name ="student DB".
Database connectivity in server side scripting is set up with a function that takes the server name, username, password and database name and returns a connection object that the rest of the script can use to run queries, for example in PHP: mysqli_connect(server, username, password, database).
<?php
$server = "localhost";
$username = "root";
$password = "";
$database = "student DB";
$conn = mysqli_connect($server, $username, $password, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$first_name = "Ram";
$last_name = "Sharma";
$mark = 78;
$email = "[email protected]";
$sql = "INSERT INTO student (first_name, last_name, mark, email)
VALUES ('$first_name', '$last_name', '$mark', '$email')";
if (mysqli_query($conn, $sql)) {
echo "Record inserted successfully";
} else {
echo "Error: " . mysqli_error($conn);
}
mysqli_close($conn);
?>
mysqli_connect() opens the connection using the given server, username, password and database, and once the connection succeeds, the INSERT INTO statement adds a new row with the first name, last name, mark and email into the student table; mysqli_query() executes that statement over the open connection.
Write a JavaScript code to calculate the factorial of a given number.
The function starts fact at 1 and multiplies it by every integer from 1 up to n using a for loop, so that after the loop finishes fact holds the value of n!; for number = 6 the code prints "Factorial of 6 is 720".
How is event-driven program (or OOP) differing from procedural-oriented programming ? Explain.
A procedural (procedure oriented) program executes a fixed sequence of instructions decided in advance by the programmer, calling functions one after another in the order they are written, and the flow of control is largely predictable f...
Explain the importance of the system testing of the system development life cycle (SDLC).
System testing is the phase of the SDLC in which the completed system is checked as a whole against the requirements that were originally specified, before it is handed over to the users. Its importance includes: - Detecting errors and b...
What is cloud computing ? Pointout the advantage and disadvantage of cloud computing.
Cloud computing is the delivery of computing services, such as storage, servers, databases, software and processing power, over the internet ("the cloud") from a remote provider, instead of running them on a local computer or private server.
Advantages:
Disadvantages:
What is network topology ? Differentiate between guided (wire media) and unguided (wireless media) with example.
A network topology is the physical or logical arrangement of the computers, cables and other devices that make up a computer network, describing how the nodes are connected to one another (for example in a star, bus, ring or mesh layout).
Guided and unguided transmission media:
| Basis | Guided (wired) media | Unguided (wireless) media |
|---|---|---|
| Signal path | Signal travels along a physical, solid conductor | Signal travels through free space (air) without a physical conductor |
| Examples | Twisted pair cable, coaxial cable, fiber optic cable | Radio waves, microwave, infrared, satellite links |
| Installation | Needs physical cabling between devices | No cabling needed between devices, so easier to deploy over distance/terrain |
| Interference | Less affected by external interference (especially fiber optic) | More prone to interference, weather effects and signal loss |
| Mobility | Devices must stay connected to the cable | Devices can move freely within signal range |
| Typical use | Wired LANs inside a building | Wi-Fi networks, mobile networks, satellite communication |
In short, guided media physically bind the signal to a cable and generally give more reliable, higher speed transmission over short distances, while unguided media broadcast the signal through the air, trading some reliability for mobility and easier coverage over larger or difficult terrain.
Write the advantage of pointer. Write a C-program to enter the radius of a football and find the area of football by using user defined function.
Advantages of pointer: pointers allow a function to directly access and modify the caller's variables (call by reference), let a program work efficiently with arrays and strings without copying them, enable dynamic memory allocation at r...
Define the structure. Write a C-program using structure to input staff id, name and the salary of 50 staffs. Display staff id, name and salary of those staff whose salary range from 25 thousand to 40 thousand.
A structure in C is a user defined data type that groups related variables of possibly different data types (such as an id, a name and a salary) under one name, so that they can be treated and passed around as a single unit.
#include <stdio.h>
struct Staff {
int id;
char name[30];
float salary;
};
int main() {
struct Staff s[50];
int i;
for (i = 0; i < 50; i++) {
printf("Enter id, name and salary of staff %d: ", i + 1);
scanf("%d %s %f", &s[i].id, s[i].name, &s[i].salary);
}
printf("\nStaff with salary between 25000 and 40000:\n");
printf("ID\tName\tSalary\n");
for (i = 0; i < 50; i++) {
if (s[i].salary >= 25000 && s[i].salary <= 40000)
printf("%d\t%s\t%.2f\n", s[i].id, s[i].name, s[i].salary);
}
return 0;
}
The structure Staff stores the id, name and salary of one staff member, and the array s[50] holds the records of all 50 staff. After all the records are read in the first loop, the second loop checks each staff member's salary and prints only the id, name and salary of those whose salary lies between 25,000 and 40,000.
Database connectivity in server side scripting is set up with a function that takes the server name, username, password and database name and returns a connection object that the rest of the script can use to run queries, for example in PHP: mysqli_connect(server, username, password, database).
<?php
$server = "localhost";
$username = "root";
$password = "";
$database = "student DB";
$conn = mysqli_connect($server, $username, $password, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$first_name = "Ram";
$last_name = "Sharma";
$mark = 78;
$email = "[email protected]";
$sql = "INSERT INTO student (first_name, last_name, mark, email)
VALUES ('$first_name', '$last_name', '$mark', '$email')";
if (mysqli_query($conn, $sql)) {
echo "Record inserted successfully";
} else {
echo "Error: " . mysqli_error($conn);
}
mysqli_close($conn);
?>
mysqli_connect() opens the connection using the given server, username, password and database, and once the connection succeeds, the INSERT INTO statement adds a new row with the first name, last name, mark and email into the student table; mysqli_query() executes that statement over the open connection.