Class 12 NEB Computer Question Model Solution 2080
Choose the correct answer.[9x1=9]
1) In which normal form of database transitive dependency should not be occurred?
A) First
B) Third
C) Scond
D) All of the above
2) Which of the following techniques is used to grant privileges to users in a database?
A) Authentication
B) Isolation
C) Authorization
D) Backup
3) Which SQL command is used to display all the records from a table named STUDENT with “H” as the first letter in the field FNAME (FIRST NAME)?
A) SELECT * FROM STUDENT WHERE FNAME LIKE “H”
B) SELECT * FROM STUDENT WHERE FNAME LIKE “%H%”
C) SELECT * FROM STUDENT WHERE FNAME LIKE "H%"
D) SELECT * FROM STUDENT WHERE FNAME LIKE "%H";
4) Which of the following is a remote login service?
A) Te1net
B) FTP
C) All of the above
D) SMTP
5) Which of the following is a server-side scripting language?
A) PHP
B) MySQL
C) JavaScript
D) SQL
6) Which of the following keywords are used to declare a variable in JavaScript?
A) int or suppose
B) float or int
C) var or let
D) char or var
7) What will be the result of combining a string with another data type in PHP?
A) float
B) int
C) string
D) double
8) The process of hiding internal details of a program and exposing the functionality is .
A) Class
B) Polymorphism
C) Inheritance
D) Data Abstraction
9) Which of the following is not a phase of SDLC?
A) Analysis
B) Developing
C) Testing
D) Meeting
Short Answer Questions [5×5=25]
10. Suppose you are appointed as an IT expert in a Hotel. What kind of database system you preferred and why? [1+4]
- Efficiency: Relational databases are very efficient at storing and retrieving data.
- Scalability: Relational databases can be easily expanded to handle large amounts of data.
- Security: Relational databases can be secured using a variety of methods, such as passwords and encryption.
- Compliance: Relational databases can be used to comply with a variety of regulations, such as the General Data Protection Regulation (GDPR).
Most of the Hospitals prefer applying a relational database model for database design compared to other models. Justify the statement with your arguments. [5]
- Efficiency: Relational databases are very efficient at storing and retrieving data. This is because data is stored in tables, which are made up of rows and columns. Each row represents a single record, and each column represents a single attribute of that record. This makes it easy to find and access specific data points.
- Scalability: Relational databases are also very scalable. This means that they can be easily expanded to handle large amounts of data. As a hospital grows, its database can grow with it.
- Security: Relational databases can be secured using a variety of methods, such as passwords and encryption. This helps to protect patient data from unauthorized access.
- Reliability: Relational databases are very reliable. They are designed to handle large amounts of data and to operate 24/7. This is essential for hospitals, which need to be able to access patient data at all times.
- Flexibility: Relational databases are very flexible. They can be used to store a wide variety of data types, including text, numbers, dates, and images. This makes them a good choice for storing the complex data that is used in hospitals.
<!DOCTYPE html>
<html>
<head>
<title>Addition value of two variables with JavaScript</title>
</head>
<body>
<h1>Addition with JavaScript</h1>
<script>
// Declare two variables and assign them values
let num1 = 5;
let num2 = 7;
// Add the values of the two variables
let sum = num1 + num2;
// Display the result on the web page using document.write
document.write("<p>The sum of " + num1 + " and " + num2 + " is " + sum + ".</p>");
</script>
</body>
</html>
OR
How can you connect MYSQL database with PHP? Demonstrate with an example. [5]
Ans:
// Database configuration
$host = 'localhost'; // hostname or IP address of the database server
$username = 'root'; // username to access the database
$password = ''; // password to access the database
$dbname = 'your_database_name'; // name of the database
$conn = mysqli_connect($host, $username, $password, $dbname);
// Check if the connection was successful
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
Ans: Following are the differences between procedural and OOP language
OOP |
Procedural-oriented Programming |
Emphasis on creating objects |
Emphasis on creating procedures/functions |
Uses classes and objects to organize code |
Uses functions/subroutines to organize code |
Uses objects to store and manipulate data |
Uses global/local variables to store and manipulate data |
Promotes code reusability through inheritance and polymorphism |
Does not have built-in support for code reusability |
Promotes modular programming through the use of objects |
Does not have built-in support for modularity |
Uses encapsulation to hide the internal workings of an object |
Does not have the concept of encapsulation |
Examples: C++, Java, Python |
Examples: Pascal, Fortran, C |
13. State various stages of SDLC and explain any two. [1+2+2]
Ans: SDLC stands for Software Development Life Cycle. It is a structured approach to the development of software. The SDLC defines a series of steps that are followed to develop high-quality software.
- Planning
- Analysis
- Design
- Development
- Testing
- Deployment
- Maintenance
14. Explain mobile computing with its advantages. [5]
The advantages of mobile computing are as here under:
- Portability: Mobile devices are small and lightweight, making them easy to carry and use on the go.
- Connectivity: Mobile devices are typically connected to the internet, allowing users to access information and services from anywhere.
- Personalization: Mobile devices can be personalized to the user's needs, making them more user-friendly.
- Affordability: Mobile devices are becoming increasingly affordable, making them accessible to a wider range of people.
- Entertainment: Mobile devices can be used for a variety of entertainment purposes, such as playing games, watching videos, and listening to music.
- Increased productivity: Mobile computing can help users to be more productive by allowing them to work from anywhere, at any time.
- Improved communication: Mobile computing can help users to communicate more effectively with others by allowing them to stay in touch via text, email, and social media.
- Enhanced learning: Mobile computing can help users to learn new things by providing them with access to educational resources on the go.
- Greater convenience: Mobile computing can make life more convenient by allowing users to access information and services without having to be at a computer.
Long Answer Questions [2×8=16]
- Centralized management: In a client-server network, all the data and applications are stored on a central server, which makes it easier for network administrators to manage and maintain the network. They can control access to data and applications, monitor network usage, and apply security policies from a single location.
- Scalability: Client-server architecture is highly scalable, as additional servers and resources can be added as needed to support more users and data. This makes it easy to expand the network as the organization grows without impacting the performance or reliability of the network.
- Enhanced security: Centralized management of client-server networks makes it easier to implement and enforce security policies across the network. Security measures, such as firewalls, intrusion detection and prevention, and data encryption can be centrally managed, reducing the risk of security breaches.
- Improved performance: Client-server networks can improve network performance by offloading processing power from the client devices to the server. This can result in faster response times, reduced network congestion, and better utilization of network resources.
- Reliable data backup and recovery: In a client-server network, data is stored on a central server, which makes it easier to back up data regularly and recover data in the event of a disaster. This helps to ensure business continuity and minimizes the risk of data loss.
Ans:
#include <stdio.h>
struct student {
int roll_number;
char name[50];
int english;
int computer;
int maths;
int nepali;
int total;
};
int main() {
struct student students[10];
int i;
for (i = 0; i < 10; i++) {
printf("Enter the roll_number of student %d: ", i + 1);
scanf("%d", &students[i].roll_number);
printf("Enter the name of student %d: ", i + 1);
scanf("%s", students[i].name);
printf("Enter the marks of student %d in english: ", i + 1);
scanf("%d", &students[i].english);
printf("Enter the marks of student %d in computer: ", i + 1);
scanf("%d", &students[i].computer);
printf("Enter the marks of student %d in maths: ", i + 1);
scanf("%d", &students[i].maths);
printf("Enter the marks of student %d in nepali: ", i + 1);
scanf("%d", &students[i].nepali);
students[i].total = students[i].english + students[i].computer + students[i].maths + students[i].nepali;
}
printf("| Roll Number | Name | English | Computer | Maths | Nepali | Total |\n");
for (i = 0; i < 10; i++) {
printf("| %d | %s | %d | %d | %d | %d | %d |\n", students[i].roll_number, students[i].name, students[i].english, students[i].computer, students[i].maths, students[i].nepali, students[i].total);
}
return 0;
}
OR
#include <stdio.h>
#include <string.h>
int main()
char name[50];
char gender;
char phone[15];
FILE *fptr;
fptr = fopen("ADDRESS.DAT", "ab+");
if (fptr == NULL) {
printf("Error opening file");
return 0;
}
char choice;
do
printf("Enter name: ");
scanf("%s", name);
printf("Enter gender (M/F): ");
scanf(" %c", &gender);
printf("Enter phone number: ");
scanf("%s", phone);
fprintf(fptr, "%s %c %s\n", name, gender, phone);
printf("Do you want to add another record? (Y/N): ");
scanf(" %c", &choice);
}
printf("\nAll records in ADDRESS.DAT:\n");
rewind(fptr);
while (fscanf(fptr, "%s %c %s", name, &gender, phone) != EOF) {
printf("Name: %s\nGender: %c\nPhone: %s\n\n", name, gender, phone);
}
fclose(fptr);
return 0;
}
No comments:
Post a Comment