-->

NEB 2072 computer science questions and solutions

 2072 computer science questions:





                                                                    Group “A”

                                                           Long Answer questions 4x10=40


Attempts any Four questions:


1.Differentiate between “while” and “do-while” loop. Write a program to display first 10 even numbers.5+5
Ans:-
First part:-

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.



second part:-
/* a program to display first 10 even numbers*/
#include<stdio.h>
int main()
{
    int i=2,k=1;
    while(k<=10)
    {
        printf("%d,",i);
        i=i+2;
        k++;
    }
return 0;
}



2.What is array? Write a program to enter 20 integers into an array and display the greatest number entered.3+7
Ans:-
Array:-
Definition: A composite variable capable of holding multiple data of same data type under a single variable name is called array.
Features:
->stores multiple values
->helps to solve complex porblem
->can be used as array as pointer
->pixel based graphics programming made easier etc

Declaration of Array:

datatype array_name [size];

Example: - int marks [10]; int x[4]={1,2,3,4};

Array size is fixed at the time of array declaration.

Generally, we use for loop () to assign data or item in memory and also use this loop to extract data from memory location.

Types of Array:

There are 2 types of array.

a) One Dimensional Array (1-D): IT is an array where we use one subscript value.It stores value in row in contigous cells.
syntax:
data type arra[value/size];
For example:
int a[10];
This array stores ten value starting from location zero na dends at 9.

b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values.
In this we use matrix concept.
syntax:
data type arra[row size][column size];
For example:
int a[2][2];
It uses two rows and two columns.
Values are stored as:

 

Column zero

Column one

Row 0 à

1(0,0)

2(0,1)

Row 1à

3(1,0)

4(1,1)

This array stores total four  values starting from location zero and ends at 1.
second part:-
/*a program to enter 20 integers into an array and display the greatest number entered*/

#include<stdio.h>
int main()
{
    int numbers[20];
    int i,great;
    printf("enter numbers\n");
    for(i=0;i<=19;i++)
    {
        scanf("%d",&numbers[i]);
    }
    great=numbers[4];
   
    
for(i=0;i<=19;i++)
    {
        if(great<numbers[i])
        {
            great=numbers[i];
        }
     
    }
    printf("greatest number =%d ",great);
    return 0;
}

3.What is a function? Write a function to add two integer numbers.3+7
Ans:-
Function:-
Function:-
Definition: A self –contained block of code that performs a particular task is called Function.
Features of function:
1.fast development
2.can be developed in team
3.More flxibility
4.Fast fault finding
5.Top-down approach to solve the problem

A function has 4 elements.

1. Function Declaration (Function Prototype)

2. Function Call

3. Function Definition
4.Returning some value


For example,
int sum(int,int);
int main()
{
  sum(2,3);
  return 0;
}
int sum(int a,int b)
{
 return a+b;
}
Here,
int sum(int,int); is called prototype.It contains two parameters.
sum(2,3) is called calling of function.
In sum(2,3), 2 and 3 are called real arguments.
int sum(int a,int b)
{
 return a+b;
}
is called body part of function.

second part:
// a function to add two integer numbers
#include <stdio.h>
int sum();
int main()
{
 sum();
return 0;
}
int sum()
{
int num1,num2;
printf("enter two numbers\n");
scanf("%d%d",&num1,&num2);
printf("sum=%d",num1+num2);
}

4.What is string? Describe any four string handling functions with examples.2+8
Ans:-

String--
           It means series of characters used in our program. We can also use digits with characters. They also act as string or a part of it. It is used when we input our name or address or somewhere their combination.

Syntax
char identifier[value];
or char identifier[value][value];

We can use he upper one if we want to input single string then. And if we want to input multiple values then we use lower one(called 2-dimensional array in string).

For example,
char name[100];
gets(name)
Here, the variable accepts value having maximum characters 100. We can also write ,
char name[10]="kathmandu";
IT stores the value in following way.

It stores values from cell location '0' and ends at null character called escape sequence. This is used to show that there is no more character beyond that. This null character is used with strings only. For  numbers, it is not used.
                        Similarly, if we want to store multiple string with same name then one-dimensional is not applicable. We use two dimensional string.
We declare:

char name[5][50];
It means, we are going to store any five names having optimum 50 characters.
Let's look below. If we have five names :RAM,SHYAM,Nita then it would like

so sequentially it stores data in different row. We use loop to execute it with different data.
Or, instead of inputting string, if we initialize strings then it can be written as
  char name[5][50]={"RAM","Shyam","Nitu"};
second part:-
1) strlen(string);-It is used to get length of given string.

 syntax:
identifer=strlen(string);
For example,
#include<stdio.h>
#include<string.h>
void main()
{
char string[100]="apple";
int k;
k=strlen(string);
printf("length=%d",k);
}
It returns 5. It also counts white spaces present in a string.
If we want want , we can also input string using scanf() or gets().

2)strrev():- It reverses the string given by us.

syntax:- strrev(string);
example:

#include<stdio.h>
#include<string.h>
void main()
{
char string[100]="apple";
printf("reverseed string=%s",strrev(string));
}

We get output "elppa". Instead of putting in output line, we can put it before printf.

3)strlwr(): This function is used to convert given string into lower case.
syntax:-
strlwr(string);
Example;
#include<stdio.h>
#include<string.h>
void main()
{
char string[100]="APPLE";
printf("string in lowercase=%s",strlwr(string));
}

It gives us "apple" as an  output.

4)strupr():This string function is used to convert all characters of  string into upper case.

syntax:
strupr(string);

example:-
#include<stdio.h>
#include<string.h>
void main()
{
char string[100]="apple";
printf("string in uppercase=%s",strupr(string));
}

We get APPLE as an output after execution.
5.Write a program which reads name, department and age from a file names “employee.dat” and display them on monitor.10
Ans:-
/*a program which reads name, department and age from a file names “employee.dat” and display them on monitor*/
#include<stdio.h>
int main()
{
 FILE *p;
char name[100];
char dept[100];
float age;
p=fopen("employee.dat","r");
while((fscanf(p,"%s %s %f",name,dept,&age))!=EOF)
{
 printf("name=%s,department=%s,age=%f\n",name,dept,age);
}
fclose(p);
return 0;
}


                                                                Group “B”

                                    Short Answer questions 7x5=35



Attempts any Seven questions:


6.What is feasibility study? Explain different levels of feasibility study.2+3

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.
7.What is normalization? Write the advantages of normalization.2+3
Ans:-
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).

  • Also realizes the option of joining only the tables that are needed.


8.What is computer network? Write the advantages and disadvantages of computer network.1+4

Ans:-
Computer network:-

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)

  • Higher flexibility( different system can be connected without any problems)

Advantages and disadvantages of computer network:
Advantages:-

  1. Sharing devices such as printers saves money.
  2. Site (software) licences are likely to be cheaper than buying several standalone licences.
  3. Files can easily be shared between users.
  4. Network users can communicate by email and instant messenger.
  5. Security is good - users cannot see other users' files unlike on stand-alone machines.
  6. Data is easy to backup as all the data is stored on the file server.
Disadvantages:-

1.Purchasing the network cabling and file servers can be expensive.
2.Managing a large network is complicated, requires training and a network manager usually needs to be employed.
3.If the file server breaks down the files on the file server become inaccessible. Email might still work if it is on a separate server. The computers can still be used but are isolated.
4.Viruses can spread to other computers throughout a computer network.
5.There is a danger of hacking, particularly with wide area networks. Security procedures are needed to prevent such abuse, eg a firewall.

9.What is E-R diagram? Explain the advantages of E-R diagram in system design.1+4
Ans:-
E-R diagram:-

The Entity-Relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. An entity is a “thing” or “object” in the real world that is distinguishable from other objects. For example, each person is an entity, and bank accounts can be considered as entities.

Entities are described in a database by a set of attributes. For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. Similarly, attributes customer-name, customer-street address and customer-city may describe a customer entity.

A relationship is an association among several entities. For example, a depositor relationship associates a customer with each account that she has. The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively.

The overall logical structure (schema) of a database can be expressed graphically by an E-R diagram, which is built up from the following components:


Advantages:-

  • Exceptional conceptual simplicity.
  • Visual representation.
  • Effective communication tool.
  • Integrated with the relational database model.
10.What are the data types used in C programming? List out.5
Ans:-
C language provides us the way to hold any type of data in it. It is called data type. In C language data types classified into two categories:-
1.Primary data type
2.secondary data type
Major data types  used in C:-Mostly we use primary data types.
Primary and secondary data types can be shown in following table.

Variable Type

Keyword

Storage 

Size

Range

Character

char

1 byte

-128 to 127

Unsigned character

unsigned char

1 byte

0 to 255

Integer

int

2 byte

-32768 to 32767

Short integer

short int

2 byte 

-32768 to 32767

Long integer

long int

4 byte

-2,147,483,648 to 2,147,483,647

Unsigned integer

unsigned int

2 byte

0 to 65535

Unsigned short integer

unsigned short int

2 byte

0 to 65535

Unsigned Long integer

unsigned long int

4 byte

0 to 4,294,967,925

Float

float

4 byte

1.2 E-38 to 3.4E+38

Double

double

8 byte

2.2E-308 to 1.7 E+308

Long double

long double

10 byte

3.4 E-4932 to 1.1 E+308


11.What is multimedia? Explain.5
Ans:-
Multimedia is a broad term for combining multiple media formats. Whenever text, audio, still images, animation, video and interactivity are combined together, the result is multimedia. Slides, for example, are multimedia as they combine text and images, and sometimes video and other types.
Following are some advantages 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.

Disadvantages:-
Accessibility

Multimedia requires electricity to be operated, which may not be available in some rural areas or may not be consistently available due to shortages and blackouts.
Distracting

Mulitimedia may take away the focus from the lesson due to its attention-grabbing formats.
Costly

Production of multimedia is more expensive than others because it is made up of more than one medium.Production of multimedia requires an electronic device, which may be relatively expensive.
Multimedia requires electricity to run, which adds to the cost of its use.

12.What is AI? What are the uses of AI? 2+3
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.
Uses:-We can use AI in following fields.

game playing
You can buy machines that can play master level chess for a few hundred dollars. There is some AI in them, but they play well against people mainly through brute force computation--looking at hundreds of thousands of positions. To beat a world champion by brute force and known reliable heuristics requires being able to look at 200 million positions per second.
speech recognition
In the 1990s, computer speech recognition reached a practical level for limited purposes. Thus United Airlines has replaced its keyboard tree for flight information by a system using speech recognition of flight numbers and city names. It is quite convenient. On the the other hand, while it is possible to instruct some computers using speech, most users have gone back to the keyboard and the mouse as still more convenient.
understanding natural language
Just getting a sequence of words into a computer is not enough. Parsing sentences is not enough either. The computer has to be provided with an understanding of the domain the text is about, and this is presently possible only for very limited domains.
computer vision
The world is composed of three-dimensional objects, but the inputs to the human eye and computers' TV cameras are two dimensional. Some useful programs can work solely in two dimensions, but full computer vision requires partial three-dimensional information that is not just a set of two-dimensional views. At present there are only limited ways of representing three-dimensional information directly, and they are not as good as what humans evidently use
 OR

Define the terms e-business and e-learning.2.5+2.5
Ans:-
e-business :-
It stands for electronic business or online business. It is a business where the transaction takes place online, and the buyer and seller need not meet in-person. Electronic business is a part of E-commerce, i.e. electronic commerce.
Advantages:-

1.24/7 Availability
2.Global Reach
Disadvantages:-


1.Innovation Pressure
2.Cost and Shipping
.


 e-learning:-
 E-learning system based on formalised teaching but with the help of electronic resources is known as E-learning. While teaching can be based in or out of the classrooms, the use of computers and the Internet forms the major component of E-learning. E-learning can also be termed as a network enabled transfer of skills and knowledge, and the delivery of education is made to a large number of recipients at the same or different times. Earlier, it was not accepted wholeheartedly as it was assumed that this system lacked the human element required in learning.

13.Write the importance of SDLC?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. 


Why SDLC/its importance:-

When business organization facing a keen competition in the market, rapid change of technology and fast internal demand, system development is necessary. In the system development, a business organization could adopt the systematic method for such development. Most popular system development method is system development life cycle (SDLC) which supports the business priorities of the organization, solves the identified problem, and fits within the existing organizational structure. And obviously software can be very difficult and complex. We need the SDLC as a framework to guide the development to make it more systematic and efficient

In summarized form we can say following reasons for SDLC.

          I. To create a better interface between the user and the system.

        II. For good accuracy and speed of processing.

       III. High security and backup of data used in system.

      IV. Sharing of data all over the world in very less and real time.

       V. new laws that force organizations to do new things, or do old things differently

      VI. changes in society, such as growing demand for better security over personal data

      VII. a desire to improve competitiveness in the fact of reducing profits and market share

14.What is MS-Access? what are the uses of MS-Access? 2+3
Ans:-
Ms-access:-
Ms-access:
Microsoft Access is a database management system from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. It is a member of the Microsoft 365 suite of applications, included in the Professional and higher editions or sold separately.

Uses:-
1.For database to store huge data
2.For development
3.For integration with third party softwares.
4.For scalability
5.For furhther distribution of data.
6.For legacy data
etc

 OR

What are the advantages of RDBMS.5
Ans:-
RDBMS:-
RDBMS stands for Relational Database Management System. It stores data in a tabular form.In RDBMS, the tables have an identifier called primary key and the data values are stored in the form of tables.
following are functions of RDBMS:
1.Normalization is present.
2.RDBMS defines the integrity constraint for the purpose of ACID (Atomocity, Consistency, Isolation and Durability) property.
3.in RDBMS, data values are stored in the form of tables, so a relationship between these data values will be stored in the form of a table as well.
4.RDBMS system supports a tabular structure of the data and a relationship between them to access the stored information.
5.RDBMS supports distributed database.
6.RDBMS is designed to handle large amount of data. it supports multiple users.
Example of RDBMS are mysql, postgre, sql server, oracle etc.

15.Write short notes on :

a) Satellite b) System Security
Ans:-

satellite:-
  • In the context of spaceflight, a satellite is an object which has been placed into orbit by human endeavor. Such objects are sometimes called artificial satellites to distinguish them from natural satellites such as the Moon.
  • Satellites are usually semi-independent computer-controlled systems. Satellite subsystems attend many tasks, such as power generation, thermal control, telemetry, altitude control and orbit control
  • satellite has on board computer to control and monitor system.
  • Additionally, it has radio antennae (receiver and transmitter) with which it can communicate with ground crew.
  • Most of the satellites have attitude control system(ACS).It keeps the satellite in right direction.
  • Common types include military and civilian Earth observation satellites, communications satellites, navigation satellites, weather satellites, and research satellites. Space stations and human spacecraft in orbit are also satellites.
  • Satellite orbits vary greatly, depending on the purpose of the satellite, and are classified in a number of ways. Well-known (overlapping) classes include low Earth orbit, polar orbit, and geostationary orbit.
System security:-
System security goes hand-in-hand with data security. System security describes the controls and safeguards that an organization takes to ensure its networks and resources are safe from downtime, interference or malicious intrusion.
Some common cyber attacks done to harm our server/computers:
1.Malware
2.Denial of Service
3.Backdoor attack
4.Direct Access Attack

etc
--------------------------------------------------------------------------------

Set B

----------




                                                    HSEB-GRADE XII -2072(2015)

                                                        Computer Science [230-D]


                                                                                                                    Time: 3 hrs Full Marks : 75

                                                                                                                    Pass Marks: 27




                                                                Group “A”

                                            Long Answer questions 4x10=40


Attempts any Four questions:

1.
a) What is looping? Describe “for” and “while” loop with appropriate examples.1+2+2
Ans:-
Looping:-
It simply says execution of different statements/blocks again and again repeatedly under certain condition. When the condition dissatisfies, the execution stops. This is called iteration or looping.
Second part:-
for loop:-
It is the most common type of loop which is used to execute a program statement or block of program statements repeatedly for a specified number of times. It is a definite loop. Mainly it consists of three expressions: initialization, condition and increment / decrement. The initialization defines the loop starting point, condition defines the loop stopping points and counter helps to increment and decrement the value of counter variable.

syntax:-
for(initialization;condition;increment/decrement )
{
statements;
}

Flowchart:-


For example:
#include<stdio.h>
int main()
{
int i;
for(i=1;i<=20;i++)
{
printf("%d,",i);
}
return 0;
}

Output:
If we execute this we will get 1,2,3....20

While loop:-

Definition:-
It executes the program statements repeatedly until the given condition is true. It checks the condition at first; if it is found true then it executes the statements written in its body part otherwise it just gets out of the loop structure. It is also known as entry control or pre-test loop.Syntax of while Loop:

initialization;

while(condition)

{

statements;

increment/decrement;

}

Where initialization means starting point, control means stopping points and increment/decrement means counter.
Flowchart:-




Examaple:
#include<stdio.h>
int main()
{
int i=1;
while(i<=20)
{
printf("%d,",i);
i=i+1;
}
return 0;
}

Output:
If we execute this we will get 1,2,3....20
b) Write a program to check if a given number is odd or even using if statement.5
Ans:-
//'C' program to know a number is even or odd
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
printf("enter a number\n");
scanf("%d",&x);
if(x%2==0)
{
printf("it is an even number");
}
else
{
printf("it is an odd number\n");
}
getch();
}

2.Describe any five string handling functions with examples.10

Ans:-
1.strcat():-

The strcat() function is used to join or concatenate one string into another string.

Syntax:

strcat(strl,str2);

where str1,str2 are two strings. The content of string str2 is concatenated with string str1.

#include <stdio.h>

#include<string.h>

int main()

{

char str1[100],str2[100];

printf("Enter two strings = ");

scanf("%s%s",str1,str2);

strcat(str1,str2);

printf("After copying the string is %s ", str1);

return 0;

}
2.strcpy();- 
We use this function to copy one string to another. while copying, one replaces another.
Syntax:-
strcpy(string1,string2);
or strcpy(destination,source);

When we copy string, this is done from source to destination (string2 to string1). If first is empty then there would not be over-writing.

Example;
#include<stdio.h>
#include<string.h>
void main()
{
char string1[100]="APPLE";
char string2[100]="grapes";
printf("copied string =%s",strcpy(string1,string2));
}

output-
We get here string1=grapes. Because 'grapes' is copied to firs string named "APPLE". We can also write in reverse order.
3.strcmp():-
The strcmp() function is used to compare two strings, character by character and stops comparison when there is a difference in the ASCII value or the end of any one string and returns ASCII difference of the character that is integer.
Syntax:

v=strcmp(strl,str2);

Where, str1 and str2 are two strings to be compared and v is a value returned by the function which is either zero(equal), positive value(descending) or negative value(ascending).

#include <stdio.h>

#include<string.h>

int main()

{

char str1[50],str2[50];

printf("Enter two strings : ");

scanf("%s%s",str1,str2);

int v=strcmp(str1,str2);

if(v==0)

printf("Both strings are same and have same ASCII value");

else if(v>0)

printf("%s comes after %s or %s has more ASCII value than %s",str1,str2,str1,str2);

else

printf("%s comes before %s or %s has more ASCII value than %s",str2,str1,str2,str1);

return 0;

}


4.strlen():-
strlen(string);-It is used to get length of given string.

 syntax:
identifer=strlen(string);
For example,
#include<stdio.h>
#include<string.h>
void main()
{
char string[100]="apple";
int k;
k=strlen(string);
printf("length=%d",k);
}
It returns 5. It also counts white spaces present in a string.
If we want want , we can also input string using scanf() or gets().
 
5.strrev():-

 It reverses the string given by us.

syntax:- strrev(string);
example:

#include<stdio.h>
#include<string.h>
void main()
{
char string[100]="apple";
printf("reverseed string=%s",strrev(string));
}

We get output "elppa". Instead of putting in output line, we can put it before printf.
3.What is array? Write a program to find addition of two matrices (3x3).2+8

Ans:-
Array:-
Definition: A composite variable capable of holding multiple data of same data type under a single variable name is called array.
Features:
->stores multiple values
->helps to solve complex porblem
->can be used as array as pointer
->pixel based graphics programming made easier etc

Declaration of Array:

datatype array_name [size];

Example: - int marks [10]; int x[4]={1,2,3,4};

Array size is fixed at the time of array declaration.

Generally, we use for loop () to assign data or item in memory and also use this loop to extract data from memory location.

Types of Array:

There are 2 types of array.

a) One Dimensional Array (1-D): IT is an array where we use one subscript value.It stores value in row in contigous cells.
syntax:
data type arra[value/size];
For example:
int a[10];
This array stores ten value starting from location zero na dends at 9.

b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values.
In this we use matrix concept.
syntax:
data type arra[row size][column size];
For example:
int a[2][2];
It uses two rows and two columns.
Values are stored as:

 

Column zero

Column one

Row 0 à

1(0,0)

2(0,1)

Row 1à

3(1,0)

4(1,1)

This array stores total four  values starting from location zero and ends at 1.
second part:-
/* to find sum of two 3x3 matrices*/
#include <stdio.h>

int main()
{
    int matrix1[3][3],matrix2[3][3];
    int i,j;
    printf("enter elements of matrix 1\n");
    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            scanf("%d",&matrix1[i][j]);
        }
    }
    printf("enter elements of matrix 2\n");
    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            scanf("%d",&matrix2[i][j]);
        }
    }
    printf("sum of two matrices is \n");
    for(i=0;i<=2;i++)
    {
        for(j=0;j<=2;j++)
        {
            printf(" %d ",matrix1[i][j]+matrix2[i][j]);
        }
        printf("\n");
    }
   

    return 0;
}



4.

a) Differentiate between structure and union.2.5+2.5
Ans:-
The differences between struct and union are given below in tabular form.
                   
struct
Union
1.It stores dis-similar data.Each gets separate space in memory.They do not share memory
1. It stores dis-similar type of data.Total memory space is equal to the member with largest size.They share memory space.
2.we can access member in any sequence .
2.We can access that whose value is recently used.
3.It uses keyword 'struct'
3.It uses keyword 'union'
4.We can initialize values of member/s and in any order
4.We can initialize that member which is first declared.
5.It consumes more memory
5.It consumes less memory.
6.Its syntax
    struct tag
{
datatype member1;
datatype member2;
datatype member3;
}variable;

6.Its syntax
    union tag
{
datatype member1;
datatype member2;
datatype member3;
}variable;

Example
struct student
{
int roll;
char sex;
float percentage;
}var;

Example
union student
{
int roll;
char sex;
float percentage;
}var;

b) Write a program to find greatest number among four numbers.5
Ans:-
/*to find the greatest value*/
#include<stdio.h>
int main()
{
    int numbers[4];
    int i,great;
    printf("enter numbers\n");
    for(i=0;i<=3;i++)
    {
        scanf("%d",&numbers[i]);
    }
    great=numbers[3];
    
    
for(i=0;i<=3;i++)
    {
        if(great<numbers[i])
        {
            great=numbers[i];
        }
       
    }
    printf("greatest number =%d ",great);
    return 0;
}


5.

a) Describe any two file handling functions.2.5+2.5
Ans:-
1.fscanf():-
The fscanf() function is used to read set of characters from file. It reads a word from the file and returns EOF at the end of file.
syntax:-
int fprintf(FILE *stream, const char *format [, argument, ...])
For example:-
fscanf(k,"%s%d",name,roll);
It reads data from a datafile pointed by file pointer k .name  and roll are variables.
2.fprintf():
The fprintf() function is used to write set of characters into file. It sends formatted output to a stream.

syntax:-

int fprintf(FILE *stream, const char *format [, argument, ...])
For example:-
fprintf(k,"%s%d","Ram kumar",12);
It writes data to a file created by file pointer k
b) Write a program to display name, age and address reading from file “record.dat”.5
Ans:-
/*program to display name, age and address reading from file “record.dat”*/
#include<stdio.h>
int main()
{
 FILE *p;
char name[100];
char address[100];
float age;
p=fopen("record.dat","r");
while((fscanf(p,"%s %s %f",name,address,&age))!=EOF)
{
 printf("name=%s,address=%s,age=%f\n",name,address,age);
}
fclose(p);
return 0;
}


                                                                Group “B”

                                            Short Answer questions 7x5=35



Attempts any Seven questions:


6.Describe the components of feasibility study.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.

Components of feasibility study:-


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.

7.Who is system analyst? List out the characteristics of system analyst.1+4
Ans:-
system analyst:-
The persons who perform above task/system analysis,design and implementation activity is know as system analyst. Somewhere we say or call by names like business engineer, business analyst etc. The work of system analyst who designs an information system is just same as an architect of a house. They work as facilitators of the development of information systems and computer applications.

skill to be with:-
following are the skills of system analyst.

1) Analytical skill:- Analytical skill is the ability to visualize, articulate (express), solve complex problems and concepts, and make decisions that make sense based on available information. Such skills include demonstration of the ability to apply logical thinking to gathering and analyzing information, designing and testing solutions to problems, and formulating plans.
2) Technical skill: Many aspects of the job of system analysts are technically oriented. In order to develop computer based IS (information systems), system analyst must understand information technologies, their potentials and their limitations. A system analyst needs technical skills not only to perform tasks assigned to him but also to communicate with other people with whom s/he works in system development. The technical knowledge of SA must be updated from time to time. S/he should be familiar with technologies such as:
                                >Micro/mini/mainframe computers, workstations
                             >Programming language
                    >Operating systems, database and file management systems, data communications standard system development tools and environments, decision support systems.
3)Managerial skill:-Management in all business is the act of getting people together to accomplish desired goals and objectives. This skill comprises planning, organizing, staffing, leading or directing, and controlling an organization (a group of one or more people or entities) or effort for the purpose of accomplishing a goal.
4)Interpersonal skill:-
Interpersonal skills are the life skills we use everyday to communicate and interact with other people, both individually and in groups. It includes
  1. verbal communication
  2. non-verbal communication
  3. listening skills
  4. problem solving
  5. decision making
  6. assertiveness (Communicating our values, ideas, beliefs, opinions, needs and wants freely.

8.Describe system flowchart with diagram.5
Ans:-

A very powerful tool which is used to depict the algorithm diagrammatically. Or graphical representation of algorithm is called flowchart. A flowchart can show and give us a bird eye view of algorithm. We can understand easily what an algorithm willing to say. While designing or drawing flowchart, we use many symbols like:




Advantages:

1.        Good means of communication.

2.        Effective analysis

3.        As Documentation tool

4.        Helps in debugging process.

Disadvantages”

1.        Time consuming.

2.        More space consuming

3.Difficult to maintain


eg. 1. to get sum of two numbers.




9.What is networking? List the advantages if networking.1+4
Ans:-

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)

  • Higher flexibility( different system can be connected without any problems)

Advantages:-
Advantages of networking in our daily life are:
  • E-mail (to send or get mails electronically worldwide)
  • Scheduling programs and having meetings at same time across world.
  • Video conferencing with sound without delay.
  • teleconferencing for people.
  • Automate banking facility
  • to surf Internet facility
  • telecommuting to work at home by accessing remote computer
  • doing business and marketing

10.Describe any two database model with diagram.5
Ans:-
We hahve many database models like, hierarchical,network,relational,E-R model, etc.Here we are going to understand about two.
Relational model:-

Three key terms are used extensively in relational database models: relations, attributes, and domains. A relation is a table with columns and rows. The named columns of the relation are called attributes, and the domain is the set of values the attributes are allowed to take.

The basic data structure of the relational model is the table, where information about a particular entity is represented in columns and rows. Thus, the "relation" in "relational database" refers to the various tables in the database; a relation is a set of tuples.So,


Relational databases

  • Data is organized into two-dimensional tables, or relations

  • Each row is a tuple (record) and each column is an attribute (field)

  • A common field appears in more than one table and is used to establish relationships

  • Because of its power and flexibility, the relational database model is the predominant design approach


name

street

city

id no.

balance

RAm

Thapagaun

KTm

00321

Rs. 900087

ekan

BAneshwor

Pokhara

008

Rs.45666

Hary

Kalanki

Ktm

9870

Rs. 65799

Sam

Koteshwor

Ktm

7890

Rs. 5600

Kale

Kalnki

Ktm

456

Rs. 65400


In this table we have used different concept like field (each column),record (each row). Each row gives us a complete information. If we have many tables then we relate them for data extractions,this is called relationship between tables.Apart from these, we also use other concept like,primary key,foreign key,Entity etc.

E-R model(E-R diagram):        

The Entity-Relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. An entity is a “thing” or “object” in the real world that is distinguishable from other objects. For example, each person is an entity, and bank accounts can be considered as entities.

Entities are described in a database by a set of attributes. For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. Similarly, attributes customer-name, customer-street address and customer-city may describe a customer entity.

A relationship is an association among several entities. For example, a depositor relationship associates a customer with each account that she has. The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively.

The overall logical structure (schema) of a database can be expressed graphically by an E-R diagram, which is built up from the following components:

  • Rectangles, which represent entity sets

  • Ellipses, which represent attributes.

  • Diamonds, which represent relationships among entity sets.

  • Lines, which link attributes to entity sets and entity sets to relationships.

for example,

1)



11.Describe network topologies with diagram.5
Ans:-
Network 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.
Although we have many types of topology, here we are going to understand about two types.


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


12.What is OOP? List the characteristics of OOP.1+4
Ans:-
OOP:-
The major motivating factor in the invention of object oriented is to remove some of the flaws encountered in the procedural oriented approach. Object oriented programming uses concept of “Object” and treats data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the functions that operate on it, and protects it from accidental modifications from outside functions.


Some features are:-
  1. Emphasis is on data rather than procedures or algorithms.
  2. Programs are divided into what are known as objects.
  3. Data structures are designed such that characterize the objects.
  4. Functions that operate on the data are tied together in the data structure.
  5. Modularity for easier troubleshooting. Something has gone wrong, and you have no idea where to look. 
  6. Reuse of code through inheritance. ...
  7. Flexibility through polymorphism. ...
  8. Effective problem solving.
13.What is multimedia? List out the components of multimedia.1+4
Ans:-
Multimedia is a broad term for combining multiple media formats. Whenever text, audio, still images, animation, video and interactivity are combined together, the result is multimedia. Slides, for example, are multimedia as they combine text and images, and sometimes video and other types.
Its components are:
1)Text: Text is the most common medium of representing the information. In multimedia, text is mostly use for titles, headlines,menu etc. The most commonly used software for viewing text files are Microsoft Word, Notepad, Word pad etc. Mostly the text files are formatted with ,DOC, TXT etc extension.

2)Audio: In multimedia audio means related with recording, playing etc. Audio is an important components of multimedia because this component increase the understandability and improves the clarity of the concept. audio includes speech, music etc. The commonly used software for playing audio files are:
i) Quick Time
ii) Real player
iii) Windows Media Player

3)Graphics: Every multimedia presentation is based on graphics. The used of graphics in multimedia makes the concept more effective and presentable.the commonly used software for viewing graphics are windows Picture, Internet Explorer etc. The commonly used graphics editing software is Adobe Photoshop through which graphics can be edited easily and can be make effective and attractive.

4)Video: Video means moving pictures with sound. It is the best way to communicate with each other. In multimedia it is used to makes the information more presentable and it saves a large amount of time. The commonly used software for viewing videos are:
i) Quick Time
ii) Window Media Player
iii) Real Player

5)Animation: In computer animation is used to make changes to the images so that the sequence of the images appears to be moving pictures. An animated sequence shows a number of frames per second to produce an effect of motion in the user's eye.

14.Describe applications of AI.5
Ans:-
Following are some applications of AI.
game playing
You can buy machines that can play master level chess for a few hundred dollars. There is some AI in them, but they play well against people mainly through brute force computation--looking at hundreds of thousands of positions. To beat a world champion by brute force and known reliable heuristics requires being able to look at 200 million positions per second.
speech recognition
In the 1990s, computer speech recognition reached a practical level for limited purposes. Thus United Airlines has replaced its keyboard tree for flight information by a system using speech recognition of flight numbers and city names. It is quite convenient. On the the other hand, while it is possible to instruct some computers using speech, most users have gone back to the keyboard and the mouse as still more convenient.
understanding natural language
Just getting a sequence of words into a computer is not enough. Parsing sentences is not enough either. The computer has to be provided with an understanding of the domain the text is about, and this is presently possible only for very limited domains.
computer vision
The world is composed of three-dimensional objects, but the inputs to the human eye and computers' TV cameras are two dimensional. Some useful programs can work solely in two dimensions, but full computer vision requires partial three-dimensional information that is not just a set of two-dimensional views. At present there are only limited ways of representing three-dimensional information directly, and they are not as good as what humans evidently use
AI in Travel & Transport
AI is becoming highly demanding for travel industries. AI is capable of doing various travel related works such as from making travel arrangement to suggesting the hotels, flights, and best routes to the customers. Travel industries are using AI-powered chatbots which can make human-like interaction with customers for better and fast response.
.

15.Write short notes on :

a) Expert System b) E-leaning
Ans:-
a)Expert System :-
                           
In artificial intelligence, an expert system is a computer system emulating the decision-making ability of a human expert. Expert systems are designed to solve complex problems by reasoning through bodies of knowledge, represented mainly as if–then rules rather than through conventional procedural code.
There are different fields where we can sue Expert system.Like,
->Medical
->Engineering
->Voice recognition
->Simulation


b) E-leaning:-
            
A learning system based on formalised teaching but with the help of electronic resources is known as E-learning. While teaching can be based in or out of the classrooms, the use of computers and the Internet forms the major component of E-learning. E-learning can also be termed as a network enabled transfer of skills and knowledge, and the delivery of education is made to a large number of recipients at the same or different times. Earlier, it was not accepted wholeheartedly as it was assumed that this system lacked the human element required in learning.
---------------------------------------------------------------------

set C

-----------




                                                        HSEB-GRADE XII - 2072(2015)

                                                        Computer Science [230-C]


                                                                                                                    Time: 3 hrs 
                                                                                                                     Full Marks : 75

                                                                                                                    Pass Marks: 27

                                                                    Group “A”


                                            Long Answer questions 4x10=40




Attempts any Four questions:

1.Write a program which finds the sum, difference and product of 2 numbers switch case statement.10
Ans:-

//WAP to find sum,difference, and product of two numbers using switch.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int choice;
int a,b,output;
printf("please enter your two numbers for a and b for operation\n");
scanf("%d%d",&a,&b);
printf("'now,we have following menu\n");
printf( "1.to get sum\n");
printf("2. to get difference\n");
printf("3 to get product\n");
printf(" any other number to exit");
printf("enter your choice 1 or 2 or 3 or any other number\n");
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("we are going to get sum\n");
printf("the sum=%d",a+b);
break;
case 2:
printf("we are going to get difference \n");
printf("the difference=%d",a-b);
break;

case 3:
printf("we are going to get product,\n");
printf("the product=%d",a*b);
break;

default:
printf("sorry, not a valid input\n");
printf("thank u, terminating....\n");
}
getch();
}
2.
a) Differentiate between while and Do-while loop with appropriate example.2.5+2.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.



b) Write a program to display the following:


1


12


123


1234


12345

Ans:-

#include <stdio.h>
int main()
{
    int i,j;
    for(i=1;i<=5;i++)
    {
        for(j=1;j<=i;j++)
        {
            printf(" %d ",j);
        }
        printf("\n");
    }
    return 0;
}

3.Write a program which asks nth terms of numbers and sort them in ascending order.10
Ans:-
/* Write a C program that reads 'n' numbers and arrange them in ascending order*/
#include <stdio.h>
int main()
{
    float numbers[200];
    int i,j,k,n;
    printf("Enter the value of  nth term\n");
    scanf("%d",&n);
    printf("Enter numbers\n");
    for(i=0;i<n;i++)
    {
        scanf("%f",&numbers[i]);
    }
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(numbers[i]>numbers[j])
            {
                k=numbers[i];
                numbers[i]=numbers[j];
                numbers[j]=k;
            }
        }
    }
    printf("numbers in ascending order are=:\n");
    for(i=0;i<n;i++)
    {
        printf("%f\n",numbers[i]);
    }
    return 0;
}


4.a) What is function? List out the advantages of functions.1+4
Ans:-
Function:-
Definition: 
A self –contained block of code that performs a particular task is called Function. It is also called user defined function because whenever user wants they can use it.Functions help us to solve complex problems easily. In this, all the functions they have their own variables,executions and outputs.We can call any function from any where and any number of time. At last all those functions we call from main() functions. It means user defined functions are dependent on main() function.
Advantages:-

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





A function has 4 elements.

1. Function Declaration (Function Prototype)

2. Function Call

3. Function Definition
4.Returning some value


For example,
int sum(int,int);
int main()
{
  sum(2,3);
  return 0;
}
int sum(int a,int b)
{
 return a+b;
}
Here,
int sum(int,int); is called prototype.It contains two parameters.
sum(2,3) is called calling of function.
In sum(2,3), 2 and 3 are called real arguments.
int sum(int a,int b)
{
 return a+b;
}
is called body part of function.

b) Write a program to find the factorial of a given number. 5
Ans:-
//program to get factorial value of a  number
#include<stdio.h>
include<conio.h>
void main()
{
   int number,fact=1,i;
   printf("enter any positive number\n");
  scanf("%d",&number);
if(number>0)

 for(i=1;i<=number;i++)
    {
     fact=fact*i;
   }
}
else
{
printf("the number is not +ve\n");
}
 printf("the factorial value for entered number=%d is =%d\n",number,fact);
getch();
}

5.
a) Describe fscanf and fprintf function. [5]
Ans:-
fscanf():-
The fscanf() function is used to read set of characters from file. It reads a word from the file and returns EOF at the end of file.
syntax:-
int fprintf(FILE *stream, const char *format [, argument, ...])
For example:-
fscanf(k,"%s%d",name,roll);
It reads data from a datafile pointed by file pointer k .name  and roll are variables.
fprintf():
The fprintf() function is used to write set of characters into file. It sends formatted output to a stream.

syntax:-

int fprintf(FILE *stream, const char *format [, argument, ...])
For example:-
fprintf(k,"%s%d","Ram kumar",12);
It writes data to a file created by file pointer k  

b) Write a program which asks name, age, roll –number of student and write it in a file “student.dat”.[5]

Ans:-
/*program which asks name, age, roll –number of student 
and write it in a file “student.dat”*/
#include<stdio.h>
int main()
{
int roll;
char name[100];
int age;
 FILE *k;
k=fopen("student.dat","w");
printf("enter student name,age and roll\n");
printf("\nand press ctrl+z to exit\n");
while((scanf("%s%d%d",name,&age,&roll))!=EOF)
{
  fprintf(k,""%s%d%d",name,age,roll);
}
fclose(k);
printf("data stored successfuly!");
return 0;
}


                                                                                Group “B”


                                                                Short Answer questions 7x5=35

Attempts any Seven questions:

6.Describe SDLC with diagram.[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. 




Why SDLC:-

When business organization facing a keen competition in the market, rapid change of technology and fast internal demand, system development is necessary. In the system development, a business organization could adopt the systematic method for such development. Most popular system development method is system development life cycle (SDLC) which supports the business priorities of the organization, solves the identified problem, and fits within the existing organizational structure. And obviously software can be very difficult and complex. We need the SDLC as a framework to guide the development to make it more systematic and efficient

In summarized form we can say following reasons for SDLC.

          I. To create a better interface between the user and the system.

        II. For good accuracy and speed of processing.

       III. High security and backup of data used in system.

      IV. Sharing of data all over the world in very less and real time.

       V. new laws that force organizations to do new things, or do old things differently

      VI. changes in society, such as growing demand for better security over personal data

      VII. a desire to improve competitiveness in the fact of reducing profits and market share

7.Define DBMS. List out the objectives of DBMS.[1+4]
Ans:-
DBMS:-

A DBMS is a system software package that helps the use of integrated collection of data records and files known as databases. It allows different user application programs to easily access the same database. DBMSs may use any of a variety of database models, such as the network model or relational model. In large systems, a DBMS allows users and other software to store and retrieve data in a structured way. Instead of having to write computer programs to extract information, user can ask simple questions in a query language. 

              Its roles/objectives can be listed as given below.

1. provides an interface to the user as well as to application

2. lets user to create,maintain databases.

3. provides high integrity and security to its data.

4. provides sharing facility to many users.

5. provides relationships between tables.

6. provides access level to different users.

7. maintains integrity,consistency of data e

8.What is Relational database model? List out the advantages and disadvantages of Relational database model.[1+4]
Ans:-

Three key terms are used extensively in relational database models: relations, attributes, and domains. A relation is a table with columns and rows. The named columns of the relation are called attributes, and the domain is the set of values the attributes are allowed to take.

The basic data structure of the relational model is the table, where information about a particular entity is represented in columns and rows. Thus, the "relation" in "relational database" refers to the various tables in the database; a relation is a set of tuples.So,


Relational databases

  • Data is organized into two-dimensional tables, or relations

  • Each row is a tuple (record) and each column is an attribute (field)

  • A common field appears in more than one table and is used to establish relationships

  • Because of its power and flexibility, the relational database model is the predominant design approach


name

street

city

id no.

balance

RAm

Thapagaun

KTm

00321

Rs. 900087

ekan

BAneshwor

Pokhara

008

Rs.45666

Hary

Kalanki

Ktm

9870

Rs. 65799

Sam

Koteshwor

Ktm

7890

Rs. 5600

Kale

Kalnki

Ktm

456

Rs. 65400


In this table we have used different concept like field (each column),record (each row). Each row gives us a complete information. If we have many tables then we relate them for data extractions,this is called relationship between tables.Apart from these, we also use other concept like,primary key,foreign key,Entity etc.

Advantages:

1.Faster

2.Multiuser

3.High accuracy

4.more Simple

Disadvantages:-

1.Information loss

2.Complexity

3.Physical storage

4.Performance

9.Describe the terms “SQL” and “DML”.[2.5+2.5]
Ans:-
SQL:-
SQL stands for  Structured Query Language; it is the most common language for extracting and organising data that is stored in a relational database. A database is a table that consists of rows and columns. SQL is the language of databases. It facilitates retrieving specific information from databases that are further used for analysis. Even when the analysis is being done on another platform like Python or R, SQL would be needed to extract the data that you need from a company’s database.
It is used for:
  • Execute queries against a database
  • Retrieve data from a database
  • Insert records into a database
  • Update records in a database
  • Delete records from a database
DML:
ans:-
A data manipulation language (DML) is a computer programming language used for adding (inserting), deleting, and modifying (updating) data in a database. ... A popular data manipulation language is that of Structured Query Language (SQL), which is used to retrieve and manipulate data in a relational database.
It uses statements select,from,where etc.
For example, if we have a table named students with some records, then to extract data with some condition, we use DML as
select *
from students
where name="ram"

10.Define computer network and explain its uses.[2+3]
Ans:-

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)

  • Higher flexibility( different system can be connected without any problems)

Uses:-

  1. Sharing devices such as printers saves money.
  2. Site (software) licences are likely to be cheaper than buying several standalone licences.
  3. Files can easily be shared between users.
  4. Network users can communicate by email and instant messenger.
  5. Security is good - users cannot see other users' files unlike on stand-alone machines.
  6. Data is easy to backup as all the data is stored on the file server.

11.Describe “simplex”, “half duplex” and “full duplex” with example.[1+2+2]
Ans:-
Simplex: - in this data flows in only one direction on data communication line. Examples are television and radios broadcasts; they go from station to our home. We can say one way communication takes place.
Half duplex: - the data flows in both directions but only direction at a time on data communication line. Each station can both transmit and receive. Example a talk on walkie–talkie is half duplex. Each person talks on turning.
Full duplex:-The data flows in both directions at same time. The system designed in such a way that data flow occurs in both the sides. Example, mobile phones, land line sets, two ways trafficking system etc.

12.Differentiate between array and structure with example.[5]
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;

13.What is E-governance? List out the objectives of E-governance.[1+4]
Ans:-
E-governance:-
Electronic governance or e-governance is the application of information and communication technology (ICT) for delivering government services, exchange of information, communication transactions, integration of various stand-alone systems and services between government-to-customer (G2C), government-to-business (G2B), government-to-government (G2G) as well as back office processes and interactions within the entire government framework.
The objectives of e governance are as follows-
1.One of the basic objectives of e-governance is to make every information of the government available to all in the public interest.
2.One of its goals is to create a cooperative structure between the government and the people and to seek help and advice from the people, to make the government aware of the problems of the people.
3.To increase and encourage people’s participation in the governance process.
4.e-Governance improves the country’s information and communication technology and electronic media, with the aim of strengthening the country’s economy by keeping governments, people and businesses in tune with the modern world.
5.One of its main objectives is to establish transparency and accountability in the governance process.

14.Describe any five application of multimedia.[5]
Ans:-
Multimedia is a broad term for combining multiple media formats. Whenever text, audio, still images, animation, video and interactivity are combined together, the result is multimedia. Slides, for example, are multimedia as they combine text and images, and sometimes video and other types.
Following are some advantages 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:

15.Write short notes on :2.5+2.5


a) Computer Crime b) Social impact of the ICT


Ans:-
a)Computer crime:-
Alternatively referred to as cyber crime, e-crime, electronic crime, or hi-tech crime. Computer crime is an act performed by a knowledgeable computer user, sometimes referred to as a hacker that illegally browses or steals a company's or individual's private information. In some cases, this person or group of individuals may be malicious and destroy or otherwise corrupt the computer or data files.


Below is a listing of the different types of computer crimes today. 
Cyberbully or Cyberstalking ,Creating Malware ,hacking.phising etc.
b) Social impacts of the ICT:-
ICT:
Internet is a web of networks i.e. interconnection of large number of computers throughout the world. The computers are connected (wired or wireless via satellite) in such a way that anybody from anywhere can access anything/ information. It is the largest network in the world just like a communication service provided by different companies.
Positive impacts in society:-
1.File sharing/transferring:-

A file can be put on a "Shared Location" or onto a File Server for instant use by colleagues does not matter what is a size of file and how many will use it. Mirror servers and peer-to-peer networks can be used to ease the load of data transfer.

2.Internet banking:-

We know that almost all banks now-a-days are using this technology for its customers as an extra facility. Internet Banking/ Online Banking allows bank customers to do financial transactions on a website operated by the banks. The customers can do almost any kind of transaction on the secured websites. They can check their account balance, transfer funds, pay bills, etc. but security is a major issue for thi






























No comments:

Post a Comment