-->

NEB year 2061 computer science questions and solutions

 NEB year 2061 computer science questions

old syllabus

---------------------------------------------------------

                                                                    2061 (2004)

                                                                                                                                Time: 3 Hrs.

                                                                                                                                Full Marks: 75

                                                                                                                                Pass Marks: 27 

Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.

                                                                                Group - A

                                                                (Long Answer Questions) 

Attempt any two Questions of the following questions[2x20=40] 

1. 

    a) The marks obtained by student in 7 different subjects are entered through the keyboard. The student gets a division as per the following rules:[10] 

            Percentage greater or equal to 60-> First division 

            Percentage between 45 and 59->Second division

             Percentage between 35 to 44-> Third division

            Percentage less than 35->Fail 

            Marks less than 35 in a subject will be declared as Fail

Ans:-

#include<stdio.h>

int main()

{

int s1,s2,s3,s4,s5,s6,s7,total;

float p;

printf("Enter the marks of five subjects");

scanf("%d%d%d%d%d%d%d",&s1,&s2,&s3,&s4,&s5,&s6,&s7);

total=s1+s2+s3+s4+s5+s6+s7;

p=(float)total/5;

printf("Total marks=%d Percentage=%0.2f\n",total,p);

if(s1>=35 && s2>=35 && s3>=35 && s4>=35 && s5>=35&& s6>=35&& s7>=35)

{

if(p>=60)

printf("First Division");

else if(p>=45 && p<=59)

printf("Second Division");

else if(p>=35 && p<=44)

printf("Third Division");

else

{

printf("Failed");

}


return 0;

}

    b) Write a program that reads different names and addresses into computer and rearrange the names into alphabetical order using the structure variables. [10]

Ans:-

/* 

C program to input name and adress of n  persons and print them

in ascending order and on the basis of name.

*/

#include <stdio.h>

#include<string.h>

struct shorting

{

  char name[100];

  char address[100];

}var[200],var1;

int main()

{

    int i,j,n;

    printf("enter total size of data\n");

    scanf("%d",&n);

    printf("enter name and address\n");

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

    {

        scanf("%s",var[i].name);

        scanf("%s",var[i].address);

    }

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

{

    for(j=i+1;j<n;j++)

    {

        if((strcmp(var[i].name,var[j].name))>0)

        {

            var1=var[i];

            var[i]=var[j];

            var[j]=var1;

        }

    }

}

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

    {

        printf("name=%s address=%s\n",var[i].name,var[i].address);    

    }

    return 0;

}


                                                                    OR 

Describe either in flowchart or algorithm the steps required to display the multiplication table of a series of given number (entered by the user). Convert this flowchart or algorithm into program code of any of the 4GL or HLL of your choice. The program should use the 'for' looping structure in calculating and displaying the multiplication table.[20]

Ans:-

Flowchart:-



code:-


/*Program to read in numbers
 and display its multiplication table
*/
#include <stdio.h>
int main()
{
int number,total,k=1,j;
printf("enter a value for total term\n");
scanf("%d",&total);
while(k<=total)
{
    printf("enter a number \n");
    scanf("%d",&number);
     j=1;
        while(j<=10)
         {
            printf("%d*%d=%d\n",number,j,number*j);
            j++;

        }
k++;
}
return 0;
}

2.

     a) Write a program using C language to read the age of 100 persons and count the number of persons in the age group between 50 to 60. Use 'for' and 'continue statements. [10]

    Ans:-

    /*C Program to read age of 40 students and count the number of students of the age between 15 and 22*/

#include<stdio.h>
#include<conio.h>
void main()
{
int i,count=0;
in age[100];
for(i=0;i<99;i++)
{
printf("enter age\n");
scanf("%d",&age[i]);
  if(age[i]>=50 && age[i]<=60)
              {
                count++;
              }
  
}

printf("total students getting in age group 50 and 60=%d\n",count);

getch();
}

    b) Differentiate between 'while' and 'do.... while' loop. What are the advantages of object oriented programming over structured programming? [5+5]

    Ans:-

    Differenceds between while and do..while are given below.


while loop

do while loop

In the while loop, condition is checked in the beginning.

In the do while loop, condition is checked at the end.

It is also known as a pre-test or entry control loop.

It is also known as post-test or exit control loop.

It is not terminated with a semicolon.

It is terminated with a semicolon.

In the while loop, statements are not executed if the condition is false.

In the do while loop, statements are executed once even the condition is false.

It uses the keyword ‘while’.

It uses two keywords ‘do’ and ‘while’.

The syntax of while loop is as follows:

initialization;

while(condition)

{

  statements;

  increment/decrement;

}

The syntax of do-while loop is as follows:

initialization;

do

 {

  statements;

  increment/decrement;

 }while(condition);

The operation of while loop can be represented using flowchart as follows:



The operation of do while loop can be represented using flowchart as follows:



Example:
#include<stdio.h>

int main()

{

    int i=1;

    while(i>=10)

    {

        printf("I love my country");

        i++;

    }

    return 0;

}

Output: This program displays nothing as output; as condition is evaluated false in the beginning.

Example:

#include<stdio.h>

int main()

{

    int i=1;

    do

    {

        printf("I love my country");

        i++;

    }while(i>=10);

    return 0;

}

Output: This program displays “I love my country as output at once.


3.

    a) Write a program using C language that reads successive records from the new data file and display each record on the screen in an appropriate format [10] 

    Ans:-

    /*Program that will read successive record from the new data file and display each record on the screen in an appropriate format*/

#include<stdio.h>

int main()

{

 FILE *p;

char name[100];

int stdno;

int eng,phy,maths,chem,csc;

p=fopen("student.dat","r");

printf("data are\n");

while((fscanf(p,"%s%d%d%d%d%d%d",name,&stdno,&eng,&phy,&maths,&chem,&csc))!=EOF)

{

 printf("name=%s,stdno=%d, english=%d,physics=%d,maths=%d,chemistry=%d ,csc=%d \n",name,stdno,eng,phy,maths,chem,csc);

}

fclose(p);

return 0;

}

    b) What is pointer? Explain the meaning of each of the following declarations: [2.5+2.5]

        i.) int *P  ii.) int *P[10] iii.) int (*P) [10] iv) int *p(void)  v) int *(char *a)

    Ans:-

    Pointer:-

A pointer is a variable that stores a memory address.  Pointers are used to store the addresses of other variables or memory items.  Pointers are very useful for another type of parameter passing, usually referred to as Pass By Address.  Pointers are essential for dynamic memory allocation.

some advantages:

1.It handles memory effectively.

2.Useful in file handling

3.Reduces spaces.

4.Reduces execution time.

Example:

#include<stdio.h>

int main()

{

int *k;

int m=90;

k=&m;

printf("address=%d",k);

printf("value=%d",*k);

return 0;

}
here , k is a pointer and will store address of a variable m. It is then printed using printf(). To print its value we have to use  indirection operator.

Second part:-

Meaning of each pointer declaration is given below:

i.) int *P :-It is a declaration of a pointer which points to an address of a variable.

ii.) int *P[10] :-It means p is an array pointing to 10 integer pointers.

iii.) int (*P) [10] :-It means p is a pointer pointing to an array of 10 integers.

iv) int *p(void) :p is a pointer function with no arguments.
v) int *p(char *a):-p is a pointer function with one pointer arguments of character type.

                                                                    Group 'B'

                                                        (Short Answer Questions) 

Attempt any five questions:[5x7 = 35] 

4. Who is database administrator? Explain the benefits of centralized database system. [3+4) 

Ans:-

A database administrator can be a user or a group of users. They collectively handle the database related jobs. DBA primary job is to ensure that data is available, protected from loss and corruption, and easily accessible as needed.


Duties of DBA:-

1. Software installation and Maintenance
2. Data Extraction, Transformation, and Loading
3. Database Backup and Recovery
4. Security
5. Authentication

Benefits of centralized database system:

Centralized database:-

A centralized database is stored at a single location such as a mainframe computer. It is maintained and modified from that location only and usually accessed using an internet connection such as a LAN or WAN. The centralized database is used by organisations such as colleges, companies, banks etc.

Benefits of centralized database:-

Some advantages of Centralized Database Management System are −

  • The data integrity is maximised as the whole database is stored at a single physical location. This means that it is easier to coordinate the data and it is as accurate and consistent as possible.
  • The data redundancy is minimal in the centralised database. All the data is stored together and not scattered across different locations. So, it is easier to make sure there is no redundant data available.
  • Since all the data is in one place, there can be stronger security measures around it. So, the centralised database is much more secure.
  • Data is easily portable because it is stored at the same place.
  • The centralized database is cheaper than other types of databases as it requires less power and maintenance.

5. Define feasibility study. Why feasibility study is important in system development process. Explain.[2+5] 

Ans:-

Feasibility study:-

 It is the measure and the study of how beneficial the development of the system would be to the organization. This is known as feasibility study. The aim of the feasibility study is to understand the problem and to determine whether it is worth proceeding..

why feasibility study?

  • What exactly is the project? Is it possible? Is it practicable? Can it be done?

  • Economic feasibility, technical feasibility, schedule feasibility, and operational feasibility - are the benefits greater than the costs?

  • Technical feasibility - do we 'have the technology'? If not, can we get it?

  • Schedule feasibility - will the system be ready on time?

  • Customer profile: Estimation of customers/revenues.

  • Determination of competitive advantage.

  • Operational feasibility - do we have the resources to build the system? Will the system be acceptable? Will people use it?

  • Current market segments: projected growth in each market segment and a review of what is currently on the market.

  • Vision/mission statement.

6. What is data security? How it can be implemented? [3+4]

Ans:-

 It simply says protection of data /information contained in database against unauthorized access, modification or destruction. The main condition for database security is to have “database integrity’ which says about mechanism to keep data in consistent form. Besides these all, we can apply different level of securities like:

    1. Physical: - It says about sites where data is stored must be physically secured.
    2. Human: - It is an authorization is given to user to reduce chance of any information leakage or manipulation.
    3. Operating system: We must take a foolproof operating system regarding security such that no weakness in o.s.
    4. Network: - since database is shared in network so the software level security for database must be maintained.
    5. Database system: - the data in database needs final level of access control i.e. a user only should be allowed to read and issue queries but not should be allowed to modify data

7. What are the different types of LAN topology? Explain. [7]

Ans:-

LAN topology:-Network topology is the arrangement of the elements of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, including command and control radio networks, industrial fieldbusses and computer networks.

As we know there are many types LAN topologies. 
1.Bus topology
2.Star topology
3.Mesh topology
4.Ring topology
5.Star-ring topology
6.Tree topology
etc
Here we are going to understand about two.

star topology:

A star topology is designed with each node (file server, workstations, and peripherals) connected directly to a central network hub, switch, or concentrator (See fig. 2).
Data on a star network passes through the hub, switch, or concentrator before continuing to its destination. The hub, switch, or concentrator manages and controls all functions of the network.
 It also acts as a repeater for the data flow. This configuration is common with twisted pair cable; however, it can also be used with coaxial cable or fiber optic cable.



                Fig. 2. Star topology

Advantages of a Star Topology

  • Easy to install and wire.

  • No disruptions to the network when connecting or removing devices.

  • Easy to detect faults and to remove parts.

Disadvantages of a Star Topology

  • Requires more cable length than a linear topology.

  • If the hub, switch, or concentrator fails, nodes attached are disabled.


Ring topology:
A ring network is a network topology in which each node connects to exactly two other nodes, forming a single continuous pathway for signals through each node – a ring. Data travels from node to node, with each node along the way handling every packet.


Advantages of Ring topology:

  • Reduced chances of data collision as each node release a data packet after receiving the token.
  • Token passing makes ring topology perform better than bus topology under heavy traffic.
  • No need of server to control connectivity among the nodes.10. Describe the wireless network system. List out deices and equipment necessary for Wi-Fi network. 3+2
disadvantages:-
1.It is difficult to find the problem.
2.To add extra noe or computer, we have to di-assemble entire networks.
3.It is expensive
4.Shutting down of one node leads entire networking to be down

Bus topology:

A linear bus topology consists of a main run of cable with a terminator at each end (See fig. 1). All nodes (file server, workstations, and peripherals) are connected to the linear cable.


Fig. 1. Linear Bus topology

Advantages of a Linear Bus Topology

  • Installation is easy and cheap to connect a computer or peripheral to a linear bus.

  • Requires less cable length than a star topology.

Disadvantages of a Linear Bus Topology

  • Entire network shuts down if there is a break in the main cable.

  • Difficult to identify the problem if the entire network shuts down.

  • Not meant to be used as a stand-alone solution in a large building.


8. Write short notes on:[3.5+3.5]

        a) Cyber law b) Fiber Optic cable 

Ans:-

 a) Cyber law :-

          This law is commonly known as the law of the internet. It governs the legal issues of computers, Internet, data, software, computer networks and so on. These terms of legal issues are collectively known as cyberspace. In other words, it is a type of law which rules on the Internet to prevent Internet related crime.

Cyber law is a new and quickly developing area of the law that pertains to persons and companies participating in e-commerce development, online business formation, electronic copyright, web image trademarks, software and data licenses, online financial transactions, interactive media, domain name disputes, computer software and hardware, web privacy, software development and cybercrime which includes, credit card fraud, hacking, software piracy, electronic stalking and other computer related offenses.                  

b) Fiber Optic cable :-

An optical fiber or optical fiber

  • is a glass thread with  a bundle of many thin fibers. 

  • transmits the packets with the speed of light.

  • It is less susceptible.

  • It has high/est bandwidth.

  • Fibers are also used for illumination, and are wrapped in bundles so they can be used to carry images, thus allowing viewing in tight spaces. Specially designed fibers are used for a variety of other applications, including sensors and fiber lasers.

  • Optical fiber typically consists of a transparent core surrounded by a transparent cladding material with a lower index of refraction. Light is kept in the core by total internal reflection. This causes the fiber to act as a waveguide.

  • No interference because of no wiring technology

                Advantages of optical fiber cable:-

  • Better bandwidth. Fibre optic cables have much greater bandwidth than metal cables. ...
  • Higher bandwidth means faster speed. ...
  • Longer transmission distances. ...
  • Greater flexibility. 
  • Improved latency. 
  • Stronger security.

                    

9. What is the multimedia? Write its application? [2.5+4.5]

Ans:-

Multimedia:-

Multimedia is content that uses a combination of different content forms such as text, audio, images, animations, video and interactive content. Multimedia contrasts with media that use only rudimentary computer displays such as text-only or traditional forms of printed or hand-produced material.

Its applications are:-

Applications of Multimedia:-

1)Multimedia in Education: Multimedia is becoming popular in the field of education. It is commonly used to prepare study material for the students and also provide them proper understanding of different subjects.Nowadays Edutainment, a combination of Education and Entertainment has become very popular. This system provides learning as well as provides entertainment to the user.

2)Multimedia in Entertainment
: Computer graphics techniques are now commonly use in making movies and games. this increase the growth of multimedia.

3)Movies: Multimedia used in movies gives a special audio and video effect. Today multimedia has totally changed the art of making movies in the world. Difficult effect, action are only possible through multimedia.

4)Games: Multimedia used in games by using computer graphics, animation, videos have changed the gaming experience. Presently, games provides fast action, 3-D effects and high quality sound effects which is only possible through multimedia.

5)Multimedia in Business: Today multimedia is used in every aspect of business. These are some of the applications:

10. Differentiate between array and structure. [7]

Ans:-

Differences between array and struct are given below.                                                                                                                                                

Arraystruct
1.It stores same type of data1. It stores dis-similar type of data.
2.It uses static memory allocation .2.I uses dynamic memory allocation.
3.It takes less time to access elements.3.It takes more time to access elements.
4.It uses index value to access elements.4.It takes help of period operator(.) to access elements.
5.It is derived data type.5. IT is user's defined data type.
6.We can not define array of array.          6.We can define array of structure.
7.Its syntax is                                          
data type identifier[value];








example,int a[20];
7.Its syntax is
struct tag
{datatype member1;
datatype member2;
data type member3;
}variable;
example,
struct det
{char name[100];
char add[40];
int  roll;
}variable;

11. Explain the term Polymorphism and Inheritance. [7]

Ans:-

polymorphism :-
Its an important OOPs concept , Polymorphism means taking more than one forms .Polymorphism gives us the ultimate flexibility in extensibility. The ability to define more than one function with the same name is called Polymorphism.Polymorphism allows the programmer to treat derived class members just like their parent class’s members. More precisely, Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to calls of methods of the same name .If a Dog is commanded to speak(), this may elicit a bark(). However, if a Pig is commanded to speak(), this may elicit an oink(). Each subclass overrides the speak() method inherited from the parent class Animal.
example is:
Simple example of Polymorphism, look at an Account (it may be checking or saving assuming each attract different dividends) you walk in a bank and ask a teller what is my balance? or dividends? you don't need to specify what kind of an account you're having he will internally figure out looking at his books and provide you the details.

Inheritance
Inheritance is mainly used for code reusability.In the real world there are many objects that can be specialized. In OOP, a parent class can inherit its behavior and state to children classes. Inheritance means using the Predefined Code. This is very main feature of OOP, with the advantage of Inheritance we can use any code that is previously created. This concept was developed to manage generalization and specialization in OOP.  Lets say we have a class called Car and Racing Car . Then the attributes like engine no. , color of the Class car can be inherited by the class Racing Car . The class Car will be Parent class , and the class Racing Car will be the derived class or child class
The following OO terms are commonly used names given to parent and child classes in OOP:
Superclass: Parent class.
Subclass: Child class.
Base class: Parent class.
Derived class: Child class
It can have many types.
single inheritance:-one derived class inherits property from one base class
multiple              “  :- one derived class inherits property from many base classes.
multi level          “ :-in this many derived classes are inherited from many base classes
hierarchical       “ :-under this many derived classes can be inherited from single base class
hybrid                 “:-it’s a combination of hierarchical and multilevel.

12. What do you understand by AI? How it effect the modern society.[3+4]

Ans:-

AI:-

Artificial intelligence is where machines can learn and make decisions similarly to humans. There are many types of artificial intelligence including machine learning, where instead of being programmed what to think, machines can observe, analyse and learn from data and mistakes just like our human brains can. This technology is influencing consumer products and has led to significant breakthroughs in healthcare and physics as well as altered industries as diverse as manufacturing, finance and retail. In part due to the tremendous amount of data we generate every day and the computing power available, artificial intelligence has exploded in recent years. We might still be years away from generalised AI—when a machine can do anything a human brain can do—, but AI in its current form is still an essential part of our world.

Second part:-

I think without AI our society can not move.Everywhere we can find use of AI to make our life better and manageable. We have found use of AI in different fields may be business, may be transport, may be aircraft,search,pattern recognition etc.So I think perhaps there would be a society which is not affected.

Not only that much we have found use of AI in watch which monitors our heart pulse, our calorie burnt, our temprature etc.Even we can see in online platforms may be stock market or B2B or C2C , when we buy or request for informtsions, it is interpreeted by a chat bt automatically.So in nutshell without AI we can not imagine our life.

Different expert system used in society:

->Medical
->Engineering
->Voice recognition
->Simulation
etc.





1 comment:

  1. Baccarat - Best Baccarat Online in Canada - FEBCasino
    You will not be able to find your favorite live bet analysis dealer online with ease 솔카지노 and without being 더킹카지노 worried. 바카라 양빵 Baccarat casino online is a great choice 에볼루션 카지노 for novice

    ReplyDelete