-->

NEB year 2064 computer science questions and solutions

 NEB year 2064 computer science questions

old syllabus:

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

                                                                                Group 'A' (Long Answer Questions)

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

1.

    a) Differentiate between break and continue statements with examples. Write a program to print first 10 terms of any series using 'for' loop.[2+3]

Ans:-

    
Differences are  given below:-


break
continue
1
It terminates the execution.
It takes the iteration to next level(skipping).
2
It can be used in loop and switch.
It can be used in switch
3
It uses keyword ‘break’.
It uses keyword ‘continue’.
4
Its syntax is
break;
Its syntax is
continue;
5
Example is
For(i=1;i<=4;i++)
{
  If(i<=2)
    Printf(“%d\n”,i);
     Break;
}
}
Example is
For(i=1;i<=4;i++)
{
  If(i<=2)
    Printf(“%d\n”,i);
     continue;
}
}

output is:1 
output is:1,2

Second part:-

/*program to print first 10 terms of any series using 'for' loop*/

#include<stdio.h>

int main()

{

    int k;

    for(k=1;k<=10;k++)

        {

            printf("%d,",k);

        }

return 0;

}    

b) What is an operator? Explain assignment, Ternary, and comma operators with examples.[2+3]

    Ans:-

    
operator:- 

It is a symbol or a character used in programming. It is used to carry out some operation.

for example: +,-,= etc
assignment operator:-
The assignment operator is used to assign the value of expression into a variable. It is written in the form:
variable = expression
Example:
x = a + b
Where x is a variable and a+b is an expression. Here the value of a + b is evaluated and substituted to the variable x.
Ternary operator:-

Ternary operator is also known as a conditional operator as it checks the condition to make decisions. It uses two symbols: the question mark (?) and the colon (:) but not together as In >= ,<= etc. This is the only operator used in C that takes three operands so it is named as ternary operator.
Syntax:
(condition)?statement1:statement2
In this operator, the first condition is checked and if it is found true then statement1 will be executed otherwise statement2 will be executed which is similar to the working style of if-else statement.
Example
a=10;
b=15;
x=(a>b) ? a : b;
Here x will be assigned to the value of b. The condition follows that the expression is false therefore b is assigned to x.

comma operator:-
                            
The comma operator can be used to link related expressions together. Comma-linked lists of expressions are evaluated left to right and value of right most expression is the value of the combined expression.

Example

value = (x = 10, y = 5, x + y);

First assigns 10 to x and 5 to y and finally assigns 15 to value. Since comma has the lowest precedence in operators the parenthesis is necessary.

    c)Write a program to read a data file.[5]

   Ans:-

    
 #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;

}

d) Write the advantage of function. Write a recursive function to calculate the    factorial of any integer number. [5]

    Ans:-

    Advantages of function:-

                        
Definition: A self –contained block of code that performs a particular task is called Function.

Advantages of functions:

1. It facilitates top down modular programming.

2. The length of a source program can be reduced by using functions at appropriate places.

3. It is easy to locate and isolate a faulty function for further investigations.

4. A function may be used by many other programs.

Second part:-
//program to get factorial value of a number using recursion
#include <stdio.h>
#include <stdlib.h>
int recur(int n);
int main()
{
 int n;
 printf("ente a number\n");
 scanf("%d",&n);
printf("the factorial value is\n");
printf("%d",recur(n));
getch();
return 0;
}
int recur(int n)
{
 if(n<=0)
  {
          return 1;
}
else
{
    return n*recur(n-1);
}

}

2.

    a) Describe the importance of any array. Write a program to store ten differentconstant variables in an array and print out the greatest number. [3+7]

Ans:-

Array:-
It may be convenient to store a collection of similar data elements in different separate variables. For example, if the age of 100 persons were to be stored in variables with unique names, it certainly would be difficult, that means 100 variables needed for assigning the individual values. So an array certainly solves this problem because basically the variable name is the same. We differentiate among the values in an array by its unique subscripts with defined size.

Importance:- It helps us to
  •  handle similar types of data in a program.
  •  solve problems like sorting, searching, indexing etc.
  •  to matrix, therefore it is easy for solving matrix related problems. And
  • Graphic is an array of pixels, so graphics manipulation can be easily done using an array.

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

Ans:-

    
/* C program to input name and adress n number of people and print them in alphabetical 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; }


3.

    a) Write a program to delete and rename data file using remove and rename command.[10]

    Ans:-

    
 remove():this function is used to delete data file from the system.

syntax is:
remove("filename");

we have following example as a program.

//WAP to show use of command “remove” in data file handling with the help of example.
 #include<stdio.h>
#include<conio.h>
void main()
{
char choice;
printf("enter ur choice\n");
choice=getchar();
if(chice=='y')
        {
              remove("data.txt");
            printf("data file deleted sccessfully\n");
         }
else
{
printf("sorry, data filenot found\n");
}
getch();
}

rename(): it is used to rename the file.
syntax is
rename("old name","new name");
 example is given below.
//WAP to show use of command “rename” in data file handling with the help of example.
 #include<stdio.h>
#include<conio.h>
void main()
{
char choice;
printf("enter ur choice\n");
choice=getchar();
if(chice=='y')
        {
              rename("data.txt","data1.txt");
            printf("data file renaming done successfully\n");
         }
else
{
printf("sorry, data file could not be renamed\n");
}
getch();
}

        

    b) Write a program to count the number of vowels and consonants in a given text. [10]

    Ans:-

    /*to find total vowels and consonant present in a string */ #include <stdio.h> #include<string.h> int main() { char str[50]; int i,count,count1; count=count1=0; printf("Enter a string : "); scanf("%[^\n]",str); //strlwr(str); for(i=0;str[i]!='\0';i++) { if(str[i]>=97 && str[i]<=122) { if(str[i]!='a' && str[i]!='e' && str[i]!='i' && str[i]!='o' && str[i]!='u' ) { count++; } else { count1++; } } } printf("total vowels= %d and consonants=%d",count1,count); return 0; }                                                                             Group 'B' (Short Answer Questions)

Attempt any five questions:[5x7= 35]

4. Differentiate between database and database management system. Explain the top down methodology of database design.[3+4]

Ans:-

Database:-

A database is a collection of data organized in a manner that allows access, retrieval, and use of that data. Data is a collection of unprocessed items, which can include text, numbers, images, audio, and video. Information is processed data; that is, it is organized, meaningful, and useful.
DBMS

With database software, often called a database management system (DBMS), users create a computerized database; add, modify, and delete data in the database; sort and retrieve data from the database; and create forms and reports from the data in the database. Database software includes many powerful features.

Top-down methodology of database design:-

            This methodology carries following properties.

  1. Breaks the massive problem into smaller subproblems.
  2. Submodules are solitarily analysed
  3. communication is not required in the top-down approach.
  4. Contain redundant information.
  5. Structure/procedural oriented programming languages (i.e. C) follows the top-down approach.
  6. It is mainly used in Module documentation, test case creation, code implementation and debugging.

5. What do you understand by AI? How it affects the society? Explain the term polymorphism and inheritance in terms of OOPs.[1+2+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.

Some AI related system in our society:
  • Artificial Intelligence Influences Business
  • Life-Saving AI
  • Entertaining AI
  • e-mail communications
  • self driving cars and buses
  • Navigation
  • web searchingetc

Second part:-



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


6. Who is system analyst? Explain the different stages of system development life cycle.[2+5]

Ans:-

SDLC is a structure or a process to develop a software followed by a development team within the software organization. It consists of a detailed plan describing how to develop, maintain and replace specific software. SDLC is also known as information systems development or application development. It is life cycle defining a methodology for improving the quality of software and the overall development process. 



SDLC's different phases are shown around the circle.
1.Planning/requirements study
2.System ananlysis
3.System design
4.System Development 
5.System testing
6.System implementation
7.System evaluation
8System maintenance

Planning:-

The first step is problem definition(study). The intent is to identify the problem, determine its cause, and outline a strategy for solving it. It defines what ,when who and how project will be carried out. 

                    As we know everything starts with a concept. It could be a concept of someone, or everyone. However, there are those that do not start out with a concept but with a question, “What do you want?” and "really, is there a problem?" They ask thousands of people in a certain community or age group to know what they want and decide to create an answer. But it all goes back to planning and conceptualization. 

                                                In this phase the user identifies the need for a new or changes in old or an improved system in large organizations. This identification may be a part of system planning process. Information requirements of the organization as a whole are examined, and projects to meet these requirements are proactively identified. 

                                             We can apply techniques like:

1) Collecting data by about system by measuring things, counting things, survey or interview with workers, management, customers, and corporate partners to discover what these people know.

2) observing the processes in action to see where problems lie and improvements can be made in workflow.

3)Research similar systems elsewhere to see how similar problems have been addressed, test the existing system, study the workers in the organization and list the types of information the system needs to produce.

2) Getting the idea about context of problem

3) The processes - you need to know how data is transformed into information.

                     Like data structures, storage, constraints that must be put on the solution (e.g. operating system that is used, hardware power, minimum speed required etc,  what strategy will be best to manage the solution etc.    

7. What is computer animation? How is it used in film making industry?[2+5]

Ans:-

Animation:-

Computer animation is the art of creating moving images via the use of computers. It is a subfield of computer graphics and animation. ... Computer animation is essentially a digital successor to the art of stop motion animation of 3D models and frame-by-frame animation of 2D illustrations.

Second part:-
Animated subjects appear to move because images appear on screen and are quickly replaced with a series of similar, slightly altered images in a sequence that suggests walking, waving, jousting or any action the viewer’s eyes perceive to be occurring. Computer animation is favored precisely because it speeds up the process of creating the many images needed for such a sequence.
                            Computer animation can originate from 2D drawings or be drawn in computer programs. A character will be scanned in to a computer animation program or a virtual skeleton of the character represents them. Once the virtual skeleton is in the program, the animator moves key features, such as limbs and mouth, to key frames, the next major movement of the character. The programs “tween” the differences between these key images and know what movements to fill in to produce the desired movements between key frame A and B. The program then renders the images, enabling it to present a fluid final form. The same process goes for any moving objects or backgrounds around the characters.

8. Explain the benefits of centralized database. What are the major responsibilities of a database Administrator? Explain in detail.[3+4]

Ans:-

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.

9. What is feasibility study? Explain different levels of feasibility study?[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.
It has following types.

1.Technical feasibility: - This is concerned with availability of hardware and software required for the development of system.The issues with can be like:
1.1) Is the proposed technology proven and practical?
1.2)the next question is: does the firm possess the necessary technology it needs. Here we have to ensure that the required technology is practical and available. Now, does it have required hardware and software?
1.3)The Last issue is related to availability of technical expertise. In this case, software and hardware are available but it may be difficult to find skilled manpower.
2.Operational feasibility:- It is all about problems that may arise during operations. There are two aspects related with this issue:
2.1) what is the probability that the solution developed may not be put to use or may not work?
                                   2.1) what is the inclination of management and end users towards solutions?
Besides these all some more issues;
                                                           a) Information: saying to provide adequate, timely, accurate and useful information to all categories of users.
                                                       b) Response time, it says about response about output in very fast time to users.
                                            c) Accuracy: A software system must operate accurately. It means, it should provide value to its users. It says degree of software performance.
           d) Services:- The system should be able to provide reliable services.
             e)Security:- there should be adequate security to information and data from frauds.
f) Efficiency: The system needs to be able to provide desirable services to users.
3) Economic feasibility: - It is the measure of cost effectiveness of the project. The economic feasibility is nothing but judging whether the possible benefit of solving the problem is worthwhile or not. Under "cost benefit analysis", there are mainly two types of costs namely, cost of human resources and cost of training.
                                                             The first one says about salaries of system analysts, software engineers, programmers, data entry operators etc. whereas 2nd one says about training to be given to new staffs about how to operate a newly arrived system.

4) Legal feasibility: - It is the study about issues arising out the need to the development of the system. The possible consideration might include copyright law, labor law, antitrust legislation, foreign trade etc.
Apart from these all we have some more types:
behaviour feasibility, schedule feasibility study etc.

10. What is networking? Distinguish between star topology and ring topology of networking principles with the help of clean diagram.[2+5]

Ans:-

Networking:-

computer network, often simply referred to as a network, is a collection of computers and devices connected by communications channels that facilitates communications among users and allows users to share resources with other users. Networks may be classified according to a wide variety of characteristics. 

Purpose of networking:-

  • Networking for communication medium (have communication among people;internal or external)

  • Resource sharing (files, printers, hard drives, cd-rom/) 

  • Higher reliability ( to support a computer by another if that computer is down)

As we know there are many types 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

11. What do your mean by data security? Explain briefly the types of security methods normally adopted in computerized environment.[2+5]

Ans:-

Data security:-

 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. 

We can apply following methods to secure our data.

Access control. This refers to controlling which users have access to the network or especially sensitive sections of the network.

Antivirus and anti-malware software. Malware, or “malicious software,” is a common form of cyberattack that comes in many different shapes and sizes.

Behavioral analytics.

In order to identify abnormal behavior, security support personnel need to establish a baseline of what constitutes normal behavior for a given customer’s users,

Data loss prevention.

  • Data loss prevention (DLP) technologies are those that prevent an organization’s employees from sharing valuable company information or sensitive data—whether unwittingly or with ill intent—outside the network. DLP technologies can prevent actions that could potentially expose data to bad actors outside the networking environment, such as uploading and downloading files, forwarding messages, or printing.
  • Firewalls.
  • Firewalls are another common element of a network security model. They essentially function as a gatekeeper between a network and the wider internet. Firewalls filter incoming and, in some cases, outgoing traffic by comparing data packets against predefined rules and policies, thereby preventing threats from accessing the network.
    etc

12. Write short notes on any two:[3.5+3.5]

a) Cyber law b) Normalization

ans:-

a)Cyber law:-

his 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) Normalization:-

In the field of relational database design, normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain undesirable characteristics—insertion, update, and deletion anomalies that could lead to a loss of integrity.
It is of following types:
1N
2N
3N
4N
and 5N
Advantages:-

Some of the major benefits include the following :

  • Greater overall database organization
  • Reduction of redundant data
  • Data consistency within the database
  • A much more flexible database design
  • A better handle on database security
  • Fewer indexes per table ensures faster maintenance tasks (index rebuilds).

sources(with thanks):-

anydifferencebetween.com

sciencedaily.com

itstillworks.com

n-able.com

2 comments:

  1. Merit Casino | New Orleans | USA | | 30 Second Chance
    ‎Features 바카라 추천 사이트 · ‎Promotions · 우리 카지노 더킹 ‎Promotions 카지노 사이트 주소 · ‎Cash 바카라 사이트 주소 Offers emasgaraj.com · ‎Promotions

    ReplyDelete
  2. Blackjack Casino Review 2021 - $20 Free + $5000 Bonus
    Blackjack Casino is 오바마 카지노 가입 쿠폰 a blackjack-themed online casino offering blackjack, The site is 해븐 카지노 also bet analysis available on the web, including many 램 슬롯 different 양방 배팅

    ReplyDelete