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
Which of the following is DML statement ? A) Create B) Select C) Create view Alter D) Drop
A collection of hyperlinked documents on the Internet is called : A) HTML B) webpage C) www D) email system
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
Which jQuery method is used to hide selected elements ? A) hide ( ) B) hide (on) C) invisible ( ) D) display (none)
Which function is used to connect to mySQL database ? A) mySqLi_open ( ) B) mySqLi_connect ( ) C) var mySqLi_query ( ) D) $mySqLi_con ( )
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.
Which a SDLC phase is used to ensure quality software ? A) implementation B) maintenance C) testing D) system study
Coaxial cable is an example of ... A) Communication software B) Guided Transmission media C) Unguided Transmission media D) All of them
Explain the Relational Data model with example.
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)).
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.
How is event-driven program (or OOP) differing from procedural-oriented programming ? Explain.
Explain the importance of the system testing of the system development life cycle (SDLC).
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.
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.