2081 NEB Grade 12

 Group B – Short Answer Questions

10. Explain any two advantages of DBMS over traditional file system.

A Database Management System (DBMS) is better than a traditional file system in many ways.

 Advantage are:

1.      Reduced Data Redundancy: In a traditional file system, the same data may be stored in many files, causing duplication.In DBMS, data is stored in a single place and shared, so duplication is reduced.

2.       Improved Data Security:In a file system, anyone can access files easily.In DBMS, access control is provided, so only authorized users can view or modify data.

 OR

Differentiate between First Normal Form (1NF) and Second Normal Form (2NF) with an example.

1NF (First Normal Form)

2NF (Second Normal Form)

1NF removes multiple values from a single field and ensures each cell contains only one value.

2NF removes partial dependency by making sure non-key attributes depend on the full primary key.

In 1NF, data may still be repeated even though values are atomic.

In 2NF, repeated data is reduced by separating related data into different tables.

1NF focuses on organizing data into rows and columns properly.

2NF focuses on the relationship between primary keys and other attributes.

Example:

Un- normalized table

Roll No.

Name

Subject

Teacher

Department

1

Ram

Account, Nepali

Hari, Gita

Account,Nepali

2

Sita

Nepali

Gita

Nepali

 1NF

Roll No.

Name

Subject

Teacher

Department

1

Ram

Account

Hari

Account

1

Ram

Nepali

Gita

Nepali

2

Sita

Nepali

Gita

Nepali

 

 

 

·         1NF means each field should contain only one value, not multiple values together.

·         In above example, subjects and teachers are split into separate rows so there is only one subject and one teacher per row.

·         This removes repeating groups and makes the table easier to read and search.

2NF

Student

Roll No.

Name

1

Ram

2

Sita

Subject

Subject

Teacher

Department

Account

Hari

Account

Nepali

Gita

Nepali

Enrollment

Roll No.

Subject

1

Account

1

Nepali

2

Nepali

 

 

 

·       2NF means the table is already in 1NF and all non-key data depends on the whole primary key.

·       In above example, student details are moved to a Student table and subject details to a Subject table, instead of repeating them.

·       This reduces duplication of data like student names and teacher information.

 11. Write a JavaScript function to check whether a given number is even or odd.

<html>

    <head>

        <title>Even or Odd</title>

    </head>

    <body>

        <script>

            var num = parseInt(prompt("Enter a number"));

            if(num % 2 == 0){

                document.write(num + " is Even");

            } else {

                document.write(num + " is Odd");

            }

        </script>

    </body>

</html>

OR

What is the purpose of the mysqli_connect() function in PHP? Describe its parameters.

The mysqli_connect() function is used to establish a connection to a MySQL database using the MySQLi (MySQL Improved) extension in PHP.

Syntax:

mysqli_connect(host, username, password, database, port, socket);

Parameter

Description

host

The hostname or IP address of the MySQL server (e.g., "localhost").

username

MySQL username (e.g., "root").

password

Password for the MySQL user. Mostly it is empty.

database

Name of the database to connect to.

       Example: 

<?php

$connection = mysqli_connect("localhost", "root", "", "school");

if (!$connection) {

    die("Connection failed: " . mysqli_connect_error());

}

echo "Connected successfully";

?>

12. Short note on class and object in OOP with an example.

In Object-Oriented Programming (OOP), classes and objects are fundamental concepts.

Class:A class is a blueprint or template for creating objects. It defines the properties (attributes) and behaviors (methods) that objects created from the class will have.

Example: A Car class might have properties like color, model, and speed, and methods like accelerate() and brake().

Object:An object is an instance of a class. It represents an entity with specific values for the class’s attributes and can perform actions defined by the class’s methods.

Example: A specific car like a "red Ferrari" is an object of the Car class.

Programming example in C++:

            class student{ private:int id; public:void getdatat(){ }} ;

            int main()

            {

                student obj;obj.getdata();

            }

    Here, obj is an object. student is a class.

13.  How do various requirement gathering techniques help in achieving a careful grasp of user needs and system requirements during SDLC's analysis phase?

During the Analysis Phase of the Software Development Life Cycle (SDLC), various requirement gathering techniques help in accurately understanding user needs and system requirements. Here's how they contribute:

·            Interviews

Directly engaging with stakeholders helps collect specific requirements, clarify user expectations, and uncover potential issues early on.

·            Surveys and Questionnaires

Efficient for gathering feedback from a large number of users, identifying common needs, preferences, and concerns.

·            Use Cases and User Stories

These techniques describe how users interact with the system, ensuring a focus on user-centric features and functionality.

·            Workshops

Collaborative sessions with stakeholders allow for deeper discussions, prioritization of requirements, and consensus-building on key features.

·            Prototyping

Developing prototypes helps stakeholders visualize the system early, refine requirements, and identify missing or misunderstood features.

 14. Give five examples of AI applications in the education. 

AI (Artificial Intelligence) refers to the capability of machines or software to simulate human intelligence. It involves the development of systems that can perform tasks such as learning, reasoning, problem-solving, and decision-making by analyzing data and adapting over time.

Its applications in the education are given below.

·         Personalized Learning
AI-driven systems analyze student performance and tailor content to individual learning styles and paces, helping students grasp concepts more effectively.

·         Intelligent Tutoring Systems
AI tutors provide real-time feedback and personalized assistance to students, helping them with subjects like math, science, and language by identifying areas of difficulty.

·         Automated Grading
AI can grade assignments and exams, especially for objective questions like multiple choice, short answers, and essays, reducing teachers' workload and providing faster feedback.

·         Virtual Learning Assistants
AI-powered chatbots or virtual assistants help students navigate courses, answer questions, and offer resources, making learning more accessible.

·         Predictive Analytics
AI uses data to predict student outcomes, such as identifying students at risk of underperforming, allowing for timely interventions and support.
                                                                                                                

 Group C – Long Answer Questions

15. Explain the difference between star ,bus and ring network topologies with examples.

Star Topology

Bus Topology

Ring Topology

All computers are connected to a central hub or switch

All computers are connected to a single main cable (backbone)

Computers are connected in a circular loop        

Central device (hub/switch) is required               

No central device is required                                

No central device is required                     

Data passes through the central device                

Data travels along the main cable in both directions         

Data flows in one direction around the ring       

Failure of one computer does not affect the network    

Failure of one computer does not affect the network          

Failure of one computer affects the entire network

Failure of hub or switch stops the whole network      

Failure of backbone cable stops the whole network            

Failure of any cable stops the whole network      

Easy to maintain and troubleshoot                     

Difficult to maintain   and troubleshoot                                                           

Difficult to maintain     and troubleshoot                                               

16.  Write a C program using structures to store and display book details.

#include<stdio.h>

struct book

{

            char b_title[100];

            char b_author[100];

            char b_publisher[100];

            float b_price;

           

}a[5];

int main()

{

            int i;

            for(i=0;i<=4;i++)

            {

                        printf("enter book title\n");

                        scanf("%s",&a[i].b_title);

                        printf("enter book author\n");

                        scanf("%s",&a[i].b_author);

                        printf("enter book publisher\n");

                        scanf("%s",&a[i].b_publisher);

                        printf("enter book price\n");

                        scanf("%f",&a[i].b_price);

            }

            printf("the records are:\n");

            for(i=0;i<=4;i++)

            {

                        printf("book title=%s\n",a[i].b_title);

                        printf("book author is=%s\n",a[i].b_author);

                        printf("book publisher is=%s\n",a[i].b_publisher);

                        printf("book price is=%f",a[i].b_price);

            }

            return 0;

           

}

OR

  Write a C program using binary file handling (putw(), getw()).

 In C programming, binary file handling is the process of reading from or writing to files in binary mode. Unlike text files, binary files store data in the same format as in memory — not human-readable but more efficient for storing complex data structures.

Why Binary Files?

·                     Faster access and processing.

·                     Stores exact memory representation (good for structs).

·                     Useful for multimedia, database, or large data applications

Example:

FILE *fp = fopen("student.dat", "wb");

In this example, the file 'stuent.data' stores data in binary format because we have used the mode 'wb'. Here 'b' stands for binary mode.

 

putw() and getw():

In C, putw() and getw() are simple functions used to write and read integers to/from a binary file. They are used for binary I/O and work directly with integer values.

Syntax:

int putw(int n, FILE *fp);   

int  variable=getw(FILE *fp);     

 Example:-

#include<stdio.h>

int main()

{

            FILE *k;

            int number;

            k= fopen("file.txt","wb+");

            printf("enter number. To exit, press ctrl+z\n");

            while(((scanf("%d",&number)))!=EOF)

            {

                        putw(number,k);

            }

            rewind(k);

            while((number=getw(k))!=EOF)

            {

                        printf("%d\n",number);

            }

            printf("data read.");

            fclose(k);

            return 0;

}

 

Popular posts from this blog

Computer

Sequential Programs