NEB Class 12 Computer Science Supplementary Exam Solution 2023
NEB - GRADE XII
2080 (2023)
Computer Science Grade Increment
(Supplementary) Examination
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'
Very
short answer questions. 9×1=9
1. Which of the following uniquely identifies each record in the table?
A) Fields B) Record
C)
Row D) Primary Key
2. Which SQL statement will show the names and heights of all basketball players taller than 6 feet?
A)
SELECT name FROM Player WHERE height >6;
B)
SELECT name FROM Player WHERE height >=6;
C)
SELECT name, height FROM Player WHERE height >6;
D)
SELECT name, height FROM Player WHERE height <6;
3. Which of the following IP address is wrong?
A)
192.168.0.1 B) 256.2.5.76
C)
127.1.1.1 D) 10.144.1.0
4. What function do you need to call to ask the user of the program to enter text in JavaScript?
A)
readLine B) readln
C)
text D) println
5. Which function is used to connect to MySql database?
A)
mysqli_connect() B) mysqli_Open()
C)
mysqli_query() D)
$mysqli_con()
6. What will be the output of the program code?
#include
<stdio.h>
#include
<string.h>
int
main()
{
char str1[20] = "Hello";
char str2[] = "world";
strcat(str1, str2);
puts(str1);
return 0;
}
A)
Hello B) World
C)
Helloworld D)
WorldHello
7. Which concept allows you to reuse the written code in OOPs?
A)
Encapsulation B)
Inheritance
C)
Polymorphism D) Class
8. Conducting feasibility analysis is done in which phase of SDLC?
A)
Planning B) Analysis
C)
Design D)
Implementation
9. What are the four V’s that best define Big Data?
A)Vacant
- Victim - Volume-Validity
B)
Validity - Velocity - Veracity- Volume
C)
Volume - Velocity - Variety- Veracity
D)
Varsity - Velocity - Volume- Validity
Group
'B'
Short
answer questions 5×5=25
10. What is the importance of a database? Describe.
Ans:
A database is an organized collection of data that is stored and managed
electronically. Databases are used to store and manage all sorts of data,
including customer records, product inventory, financial data, and scientific
data.
Databases are important because they allow us to store and manage large amounts of data efficiently and effectively. Databases also allow us to easily access and retrieve data, and to
generate reports and analytics.
Here are some of the benefits of using a database:
Data
Storage: Databases provide a structured and efficient way
to store and organize vast amounts of data. They are capable of handling a wide
range of data types, from text and numbers to multimedia files.
Data
Integrity: Databases offer mechanisms to ensure data accuracy
and consistency. They provide features like data validation, constraints, and
referential integrity to maintain data quality.
Data
Security: Databases offer security features to protect
sensitive information. Access control, authentication, and encryption
mechanisms help secure data from unauthorized access and breaches.
Avoid
Data Redundancy: Databases help reduce data redundancy
by storing data in a centralized location. This reduces the risk of data
inconsistency and duplication.
Data
Backup and Recovery: Databases offer backup and recovery
mechanisms to protect against data loss due to hardware failures, disasters, or
human errors.
Web
Applications: Databases are the backend storage for
many web applications and websites. They store user profiles, content, and
transaction history.
OR
Describe the relational data model.
Ans:
The relational data model is a data model that organizes data into tables.
Tables are made up of rows and columns, where each row represents a single
record and each column represents a single attribute of that record.
The
relational data model is the most widely used data model today. It is used by
popular relational database management systems (RDBMSs) such as MySQL,
PostgreSQL, and Oracle Database.
The relational data model has a number of advantages over other data models, including:
- It is simple and easy to understand.
- It is flexible and can be used to model a wide variety of data.
- It is efficient and scalable.
- It supports complex queries and analysis.
The following are the limitations of the relational database model:
- Managing backups and recovery processes in relational databases can be complex, especially for very large databases.
- Relational databases can suffer from performance issues when dealing with large datasets or complex queries.
- Relational databases are not designed for real-time data processing, and can struggle to keep up with high volumes of data streaming in real time.
11. Write a program to find the largest number among three numbers in JavaScript.
Ans:
<html>
<head>
<title>conditional
statement</title>
<script>
let
num1 = parseFloat(prompt("Enter the first number:"));
let
num2 = parseFloat(prompt("Enter the second number:"));
let
num3 = parseFloat(prompt("Enter the third number:"));
if
(num1 >= num2 && num1 >= num3) {
alert(num1 + " is the greatest
number.");
}
else if (num2 >= num1 && num2 >= num3) {
alert(num2 + " is the greatest
number.");
}
else {
alert(num3 + " is the greatest
number.");
}
</script>
<body>
</body>
</html>
OR
How
do you connect MySQL database with PHP? Explain with an example.
12.
Describe the inheritance concept with an example.
Ans:
Inheritance is a powerful concept in object-oriented programming (OOP) that
allows you to create new classes based on existing classes. The new class,
called the subclass, inherits all the properties and behaviors of the existing
class, called the superclass. The subclass can also extend or modify the
functionality of the superclass.
Here
are some of the benefits of using inheritance:
- Code reuse: Inheritance allows you to reuse code by creating a new class based on an existing class. This can save you time and effort, and it can also help to improve the quality of your code.
- Code organization: Inheritance can help you to organize your code more effectively. This makes your code easier to understand, maintain, and extend.
- Code extensibility: Inheritance makes it easy to extend your code without having to rewrite it from scratch. This can be helpful when you need to add new features or functionality to your application.
Here
is an example of how inheritance can be used in the real world:
13. Describe the different requirement collection methods for the development of software.
Ans:
There are a variety of requirement collection methods that can be used for the
development of software. Some of the most common methods include:
14.
Define cloud computing services.
Ans:
Cloud computing services are a broad category of services that provide
on-demand access to computing resources, including servers, storage, databases,
networking, software, analytics, and intelligence. These services are hosted in
the cloud, meaning that they are stored on remote servers and accessed over the
internet.
There
are three main types of cloud computing services:
Group
'C'
Long
answer questions 8×2=16
15. Describe the CAT-6 and optical fiber cable features. Which of the cable category is more suitable to develop the local area network ? 5+3
Ans:
CAT-6 and optical fiber cables are two types of network cables that are used to
transmit data. CAT-6 is a twisted pair copper cable, while optical fiber is a
cable that uses light to transmit data.
CAT-6
cable features:
- Supports speeds up to 10 Gbps
- Distance up to 100 meters
- Backward compatible with CAT-5 and CAT-5e cables
- Relatively inexpensive
- Easy to install
- Not immune to electrical interference
Optical
fiber cable features:
- Supports speeds up to 100 Gbps
- Long distances
- Immune to electrical interference
- Expensive
- Difficult to install
CAT-6
cable is more suitable to develop the local area network (LAN) than fiber optic
cable for most cases.
Following
are the reasons:
- Cost: CAT-6 cable is significantly less expensive than fiber optic cable.
- Ease of installation: CAT-6 cable is easier to install and terminate than fiber optic cable.
- Speed: CAT-6 cable supports speeds up to 10 Gbps, which is sufficient for most LAN applications.
- Distance: CAT-6 cable can be used for distances up to 100 meters, which is sufficient for most LAN deployments.
Fiber
optic cable is a good choice for LANs that require very high speeds or that
need to cover long distances. However, for most LANs, CAT-6 cable is a more
cost-effective and practical solution.
16. What is structure? Write a program to store five students’ information (ID, Name, DOB and phone) and display them using structure. 2+6
Ans:
A structure in C programming is a user-defined data type that allows you
to group together related variables of different data types. This can be useful
for organizing your code and making it more readable and maintainable.
#include
<stdio.h>
struct
Student {
int id;
char name[20];
char dob[10];
char phone[10];
};
int
main() {
struct Student students[5];
for (int i = 0; i < 5; i++) {
printf("Enter student %d's
information:\n", i + 1);
printf("ID: ");
scanf("%d", &students[i].id);
printf("Name: ");
scanf("%s", students[i].name);
printf("DOB: ");
scanf("%s", students[i].dob);
printf("Phone: ");
scanf("%s", students[i].phone);
}
printf("\nStudent information:\n");
for (int i = 0; i < 5; i++) {
printf("ID: %d\n",
students[i].id);
printf("Name: %s\n",
students[i].name);
printf("DOB: %s\n",
students[i].dob);
printf("Phone: %s\n",
students[i].phone);
}
return 0;
}
OR
What is Pointer? Write a program to read and write data from a file using file handling functions. 3+5
Ans:
A pointer in C programming is a variable that stores the address of another
variable. Pointers can be used to access and manipulate the data stored in the
other variable. Pointers are a powerful tool that can be used to write more
efficient and concise C code.
#include
<stdio.h>
#include
<stdlib.h>
int
main()
{
FILE *file;
file = fopen("sample.txt",
"w");
if (file == NULL) {
printf("Unable to open the
file.\n");
return 1; // Exit with an error code
}
fprintf(file, "Hello, File Handling in
C!\n");
fprintf(file, "This is a sample
file.\n");
fclose(file);
file = fopen("sample.txt",
"r");
if (file == NULL) {
printf("Unable to open the file
for reading.\n");
return 1; // Exit with an error code
}
printf("Contents of the
file:\n");
char ch;
while ((ch = fgetc(file)) != EOF) {
putchar(ch); // Print character by
character
}
fclose(file);
return 0; //
}
No comments:
Post a Comment