Group A
Multiple Choice Question
Choose the correct answer:
1. In which normal form of database transitive dependency should not
occur?
A) First
B) Second
C) Third
D) All of the above
Correct Answer: Option C (Third)
2. Which of the following techniques is used to grant privileges to users
in a database?
A) Authentication
B) Authorization
C) Isolation
D) Backup
Correct Answer: Option B (Authorization)
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":
Correct Answer: Option C (
4. Which of the following is a remote login service?
A) FTP
B) Telnet
C) SMTP
D) All of the above
Correct Answer: Option B (Telnet)
5. Which of the following is a server-side scripting language?
A) PHP
B) MySql
C) JavaScript
D) SQL
Correct Answer: Option A (PHP)
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
Correct Answer: Option C (var or let)
7. What will be the result of combining a string with another data type in
PHP?
A) Float
B) int
C) string
D) double
Correct Answer: Option C (String)
8. The process of hiding the internal details of a program and exposing the
functionality is
A) Class
B) Polymorphism
C) Inheritance
D) Data Abstraction
Correct Answer: Option D (Data Abstraction)
9. Which of the following is not a phase of SDLC?
A) Analysis
B) Developing
C) Testing
D) Meeting
Correct Answer: Option D (Meeting)
Group B
Short Answer Question
10. Suppose you are appointed as an IT expert in a hotel. What kind of
database system you preferred and why?
Answer:
As an IT expert in a hotel, I would prefer a relational database system to
manage the hotel's data. A relational database is a type of database that
organizes data into tables, where each table contains multiple rows and
columns, and each row represents a single record or instance of data.
Here are some reasons why a relational database system would be a good
choice for a hotel:
-
Data organization: Relational databases allow the hotel to organize its data
in a logical and structured way. For example, the hotel can create tables
for customer information, room availability, reservations, and billing. This
makes it easier to retrieve and update data, and ensures that the data is
accurate and consistent.
-
Data integrity: Relational databases enforce data integrity by using
constraints and relationships between tables. For example, the database can
ensure that each customer record has a unique identifier and that a
reservation can only be made for an available room.
-
Scalability: Relational databases are designed to handle large amounts of
data and can be easily scaled to accommodate growth. This is important for a
hotel that may have thousands of guests and reservations.
-
Security: Relational databases offer security features such as user
authentication, access control, and encryption. This helps to protect
sensitive information such as customer names, addresses, and credit card
numbers.
OR
Most hospitals prefer applying a relational database model for database
design compared to other models. Justify the statement with your
arguments.
Answer:
There are several reasons why hospitals prefer using a relational database
model for database design over other models:
-
Structured Data: The relational database model allows for highly structured
data, which is ideal for storing patient information, medical records, and
other critical data that requires consistency and accuracy.
-
Data Integrity: The relational database model provides strong data integrity
and consistency through the use of constraints, such as primary keys,
foreign keys, and referential integrity. This ensures that data is accurate
and reliable, reducing the likelihood of errors and inconsistencies.
-
Scalability: Relational databases can be scaled easily as data volumes grow,
without sacrificing performance or data integrity. This makes them ideal for
large hospitals with a high volume of patient data.
-
Query Flexibility: The relational database model provides flexible querying
capabilities that allow users to retrieve data using various criteria, such
as date range, patient name, or medical condition. This makes it easier for
hospital staff to retrieve relevant information quickly and efficiently.
-
Standards: The relational database model is an industry-standard, which
means that there are many tools, applications, and technologies available
that support this model. This makes it easier for hospitals to find and use
compatible software and systems.
Overall, the relational database model offers a combination of structured
data, data integrity, scalability, query flexibility, and industry standards
that make it an ideal choice for hospitals and healthcare organizations.
11. Write a program in JavaScript to add the values of any two
variables.
Answer:
<html>
<head>
<title>Add two variables</title>
</head>
<body>
<script>
let num1 = parseFloat(prompt("Enter the first number:"));
let num2 = parseFloat(prompt("Enter the second number:"));
let sum = num1 + num2;
console.log(sum);
</script>
</body>
</html>
OR
How can you connect the MYSQL database with PHP? Demonstrate with an
example.
Answer:
To connect MySQL database with PHP, you can use the following steps:
(1) Create a new PHP file and write the following code to establish a connection with MySQL:
<?php $servername = "localhost"; $username = "your_username"; $password = "your_password"; $dbname = "your_database_name"; $conn = mysqli_connect($servername, $username, $password, $dbname); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } echo "Connected successfully"; ?>(2) Replace "your_username", "your_password", and "your_database_name" with your actual MySQL username, password, and database name.
(3) Save the PHP file and run it in a web browser. If the connection is successful, you should see the message "Connected successfully" displayed in the browser.
12. Differentiate between OOP and procedural-oriented language.
Answer:
OOP |
POP |
It stands for Object-oriented Programming. |
It stands for Structure-oriented Programming. |
The program is divided into objects. |
The program is divided into functions. |
Bottom-up approach. |
Top-down approach. |
Inheritance property is used. |
Inheritance is not allowed. |
It uses an access specifier. |
It doesn’t use an access specifier. |
Encapsulation is used to hide the data. |
No data hiding. |
EXAMPLE: C++, Java. |
EXAMPLE: C, Pascal. |
13. State various stages of SDLC and Explain any two.
Answer:
Software development refers to a set of computer science activities
dedicated to the process of creating designing deploying and supporting
software development and is often conducted by software developers
software engineers and programmers.
SDLC consists of a set of development activities that have a prescribed
order. It is the development of software in chronological order.
System Study |
↓ |
System Analysis |
↓ |
Feasibility Study |
↓ |
System Design |
↓ |
System Development |
↓ |
System Testing |
↓ |
Implementation |
↓ |
Maintenance and Review |
The different phases of SDLC are as follows:
i) System study:
A system is intended to meet the needs of an organization. Thus, the first
step in the design is to specify these needs or requirements. The top
manager of the organization takes the basic decision to use a
computer-based (information) system for managing the organization.
ii) System analysis:
system analysis is the dissection of a system into its component pieces to
study how those component pieces interact and work. System analysis is a
term that collectively describes the early phases of development. It is
defined as those phases and activities that focus on the business problem,
independent of technology.
14. Explain Mobile computing with its advantages.
Answer:
Mobile Computing is a technology that allows the transmission of data,
voice and video via a computer or any other wireless-enabled device
without having to be connected to a fixed physical link.
Advantages of Mobile Computing:
Location Flexibility
Saves Time
Enhanced Productivity
Ease of Research
Entertainment
Streamlining of Business Processes
Group C
Long answer Question
15. Suppose you are appointed as an IT expert of any bank which network
architecture do you prefer and why?
Answer:
As an IT expert of a bank, I would prefer a client-server network
architecture. Since the bank has a large number of branches and a huge
number of working employees so client-server network architecture will be
a better option. This is because a client-server architecture offers
several advantages that are particularly important for a financial
institution like a bank.
Firstly, the client-server architecture allows for centralized control and
management of resources. In a client-server network, the server acts as a
central point of control, managing resources such as databases, files, and
applications. This centralization ensures that data is consistent and
up-to-date, which is critical for a financial institution where accuracy
and reliability are paramount.
Secondly, client-server architecture provides better security. The
centralized control and management of resources allow for a single point
of control for access to sensitive information, which can be protected by
firewalls, encryption, and other security measures. This makes it easier
to implement security protocols and ensure compliance with
regulations.
Finally, client-server architecture provides better scalability and
performance. As the bank grows, it can add more servers to handle
increased traffic, ensuring that the network remains responsive and
reliable. In contrast, peer-to-peer networks can become slow and unstable
as the number of nodes increases.
In Conclusion, a client-server architecture would provide the bank with
the security, scalability, and reliability necessary to manage its data
and applications effectively.
16. Write a program n C using structure to enter the roll number, name,
and marks scored in English, computer, Maths, and Nepali of 10 students.
Also, display them in proper format along with the total marks. [Note:
the marks should be between 0 to 100]
Answer:
#include <stdio.h>
struct student {
int roll;
char name[50];
int english_marks;
int computer_marks;
int maths_marks;
int nepali_marks;
int total_marks;
};
int main()
{
int i;
struct student stu[10];
for(i=0; i<10; i++) {
printf("Enter roll number, name, English marks, Computer marks, Maths
marks, Nepali marks of student %d:\n", i+1);
scanf("%d %s %d %d %d %d", &stu[i].roll, stu[i].name,
&stu[i].english_marks, &stu[i].computer_marks,
&stu[i].maths_marks, &stu[i].nepali_marks);
stu[i].total_marks = stu[i].english_marks + stu[i].computer_marks +
stu[i].maths_marks + stu[i].nepali_marks;
}
printf("\n\n");
printf("Roll\tName\t\tEnglish\tComputer\tMaths\tNepali\tTotal\n");
printf("----------------------------------------------------------------\n");
for(i=0; i<10; i++) {
printf("%d\t%s\t\t%d\t%d\t\t%d\t%d\t%d\n", stu[i].roll, stu[i].name,
stu[i].english_marks, stu[i].computer_marks, stu[i].maths_marks,
stu[i].nepali_marks, stu[i].total_marks);
}
return 0;
}
OR
Write a Program in C to create and store name, gender, and phone number
of students to a data file named “ADDRESS.DAT”. The program should
prompt the user whether to continue or not. The program should also
display all the records in the proper format.
Answer:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Student {
char name[50];
char gender[10];
char phone[20];
};
void addStudent() {
struct Student student;
printf("\nEnter student details:\n");
printf("Name: ");
scanf("%s", student.name);
printf("Gender: ");
scanf("%s", student.gender);
printf("Phone Number: ");
scanf("%s", student.phone);
FILE *fp = fopen("ADDRESS.DAT", "ab");
fwrite(&student, sizeof(struct Student), 1,
fp);
fclose(fp);
}
void displayStudents() {
struct Student student;
FILE *fp = fopen("ADDRESS.DAT", "rb");
printf("\n%-20s%-10s%-20s\n", "Name", "Gender", "Phone
Number");
while(fread(&student, sizeof(struct Student), 1,
fp)) {
printf("%-20s%-10s%-20s\n",
student.name, student.gender, student.phone);
}
fclose(fp);
}
int main() {
char choice;
do {
printf("\nDo you want to add a
new student record? (y/n): ");
scanf(" %c", &choice);
if(choice == 'y' || choice ==
'Y') {
addStudent();
}
else {
break;
}
} while(1);
displayStudents();
return 0;
}