-->

NEB 2071 computer science questions and solutions


NEB 2071 computer science questions and solutions

set A





                                            HSEB-GRADE XII - 2071(2014)

                                Computer Science [230-Supplementary]

                                                                                                            Time: 3 hrs 
                                                                                                             Full Marks : 75

                                                                                                            Pass Marks: 27


                                                        Group “A”

                                    Long Answer questions 4x10=40


Attempts any Four questions:


1.What are the data types available in C programming? Explain in details with examples.10
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.they are
int,float,double,char

Integers:- An integer can be a whole number but not a fractional number. It can accept any + ve or –ve number.  It is very common type of data used by computer. When we add/subtract/divide/multiply, we get integer but if output is in fractional, the system just truncates that decimal part and returns only integer part. Like 1+2 yields 3. 3 divided by 2 yields 1. For this data type in some language, we use some suffix like % or word like ‘int’.

                  

Floating part:- If we are going to write a program which includes some like fraction type of data then we use this data type. Like, 1.23, -.34.45 etc. the computers recognize the real numbers having fractions easily and processes accordingly. For float type of data, we use some words like ‘float’ and some where suffix like ! or #.

                            

                        

Character type:- Simply a letter or a number or space or any other symbol which we use in program is called character. A single character is placed in a single quote like ‘a’ or ‘,’ or ‘1’ etc. but, if we combine many characters then we put inside double quote like “computer”, it has 8 characters. For this type, we use reserved word like ‘char’ in C and some where it is not needed.

                            

                       String type: A data type which contains many characters together and mostly put inside double quote (in most language) is called string. Like “computing” or “education” etc. for this, we use reserved word char with some index value. In C, we can write char name[20];. Here name is a string type of data and holds up to 20 characters.


Double:-  
This data type is used for exponential values and for more accuracy of digits.It's working range is more than others. so if we want to use long numbers of any type and high accuracy then...? for example,
   data type variable;
double ab;
'ab' is a variable of double type. It can store exponential values (3x104). It ca n be written as 3e+4 or 3E+4. If power is in negative form then it can be in 3e-4 or 3E-4. It has one advantage over others that it can be used in place of others easily.

2.What is looping? Write a program to calculate and display the multiplication table using loop.2+8

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.
It is of following types:
1.while loop
2.do..while loop
3.for loop
4.Nested loop
5.Infinite loop
SEcond part:-
//program to display multiplication table of a number .
#include<stdio.h>
#include<conio.h>
void main()
{
int k=1,n;
printf("enter value of 'n'(as a number)\n");
scanf("%d",&n);
while(k<=10)
   {
      printf("%d*%d=%d\n",n,k,n*k);
      k++;
   }
getch();
}
3.Describe the “strcat”, “strcpy”, “strcmp”, “strlen” and “strrev” string functions with examples.10
Ans:-
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;

}
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.
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;

}


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().
 
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.
4.Write a program to arrange the elements of an array in ascending order.10
Ans:-
//program to sort 'n' elements in ascending order
  #include<stdio.h>
  #include<conio.h>
  void main()
  {
  clrscr();
  int arr[200];    
  int size;     
  int i,j,k;      
 printf("enter size of elements \n");
  scanf("%d",&size); 
printf("enter array's elements\n");                 
  for(i=0;i<size;i++)
   {                            
     printf("enter elements for location=%d\n",i);
     scanf("%d",&arr[i]);      
   }
   printf("elements' sorting process started\n");
   for(i=0;i<size;i++)
   {
       for(j=i+1;j<size;j++)
        {
           if(arr[i]>arr[j])
             {
                 k=arr[i];
                 arr[i]=arr[j];
                arr[j]=k;
             }
       }
}
printf("in ascending order,elements are\n");
for(i=0;i<size;i++)
   {                            
     printf("%d\n",arr[i]);      
   }
getch();
}

5.What is “fscanf” function? Write a program to display name, age and address reading from a file named “record.dat”.10
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.
second part:-
/*program which reads name,age and address from a file named “record.dat” and display them.
*/
#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.What is feasibility study? Why it is necessary before designing a system.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.

second part:-

why feasibility study? To get answer of following questions before we start actual development of system, we need fesaibility study.

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

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

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

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

  • Customer profile: Estimation of customers/revenues.

  • Determination of competitive advantage.

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

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

  • Vision/mission statement.

·     Definition of proposed operations/management structure and management method etc.

7.What is computer network? 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.

                
8.What is MS-Access? What are the basic components of Microsoft Access? List out.5
                            Or

        What are operators used in C-programming? Explain with examples.1+4
Ans:-
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.
Basic components:-
The major components of MS Access are as follows:
  • Tables.
  • Queries.
  • Relationships.
  • Macros.
  • Forms.
  • Reports.
  • Module
                                                                            OR
Ans:-
operator:-
operator:- It is a symbol or a character used in programming. It is used to carry out some operation.
for example: +,-,= etc
Types of operator:-
It is of following types.
1)Arithmetic operator: It is used to do arithmetic calculations/operation.
 It has following types.

 +         -----------> used for addition.example is a+b. It means we are performing addition with the help of operand a and b
-           ------------>It is used for subtraction.Example is a-b.  It means we are performing subtraction with the help of operand a and b
* -------------------->used for multiplication.example is a*b. It means we are performing multiplication with the help of operand a and b
/---------------->used for division.example is a/b. It means we are performing division with the help of operand a and b
%---------------->used for remainder division.example is a%b. It means we are performing division with the help of operand a and b.It gives us remainder after division.

2)relational operator: 
This operator is used to perform comparisons between variables.It supports us to take decision logically. example,x>y ,x>=y etc
Relational operator has following types.


>------> It is used to show greater than. like x>y
>=----->It is used to show greater than or equals to.like x>=y
<-------->It is used to show a variable is smaller than another.like x<y
<=-------> It is used to show smaller than or equals to with another variable.Like x<=y
!=----------> I simply says , two variables are not equal in value.like x!=y
==---------->It says two variables have same value.It is used to test values of two variables.

3)Logical operator:-
                                   This operator is quite helpful when we want to combine multiple  conditions and take decision.It returns values in the form of 0 o 1.It works logically.
Its types are:

3.a)and (&&)-----------> It is called 'and'operator.It is used to combine multiple conditions.It gives us true output if all of them are true otherwise we get false output.
 example:if(a>b && a>c)
                      {
                            display a     
                        }
 we can see here that to be greatest,value of 'a' must be greater than b and c. So we use here '&&'
   
  3.b)or(||):- It is called 'or'operator.It is used to combine multiple conditions.It gives us true output if anyone of them is true or all are true otherwise we get false output.
 example:if(a==90 || b==90 || c==90)
                      {
                            display right angle triangle  
                        }
 we can see here that to be right angled triangle,either 'a'or 'b'or 'c' a must be 90 . So we use here '||'.

3.c) !(not )operator:-
                                It is used to reverse the result.
example
int a=5;
if(!(a==5))
{
printf("it is\n");
}
else
{
printf("it is not\n");
}
here ,the value is 5 but we get output "it is not".It is called reversing the output.

4) Assignment operator:
                                an operator ,symbolized by '=' character,is called assignment operator.It assigns value to variable.
example:
int a=6;
It means, we are assignming value 6 to variable a.

5)Unary operator:- this operator  works on one operand only.It has two types.
                               I) increment operator:- It increases the value of given variable by one.For example: ++y or y++
                                             It can be classified into pre-increment and post increment.
                                                 pre-increment:- It is written as ++x.It means first increase the value and then use that.
                                                 post-increment: It is written as x++.It means, first use that and then increase its value by one.

                               II)decrement operator:- It decreases the value of given variable by one.For example: --y or y--
                                             It can be classified into pre-decrement and post decrement.
                                                 pre-decrement:- It is written as --x.It means first decrease the value and then use that.
                                                 post-decrement: It is written as x--.It means, first use that and then decrease its value by one.


Besides these all, we have some other operators .like  bitwise,

9.Explain the array and structure with examples.2.5+2.5


Ans:-
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.
Structure:
.It stores dis-similar data.Each gets separate space in memory.They do not share memory.we can access member in any sequence.It uses keyword 'struct'.We can initialize values of member/s and in any order.It consumes more memory.
Its syntax is,
    struct tag
{
datatype member1;
datatype member2;
datatype member3;
}variable;

Example
struct student
{
int roll;
char sex;
float percentage;
}var;
10.Who is database administrator? List the roles of database administrator.1+4

Ans:-
Database Administrator:-
A database administrator (DBA) is a person/s who is/are responsible for the environmental aspects/activities related to database. The role of a database administrator has changed according to the technology of database management systems (DBMSs) as well as the needs of the owners of the databases.
                Duties/roles:
1. Installation of new software.
2. Configuration of hardware and software with the system administrator
3. Security administration
4. Data analysis
5. Database design (preliminary
6. Data modeling and optimization
7. Responsible for the administration of existing enterprise databases and the analysis, design, and creation of new databases

11.What is e-governance? List the importance of e-governance.1+4

Or

What is expert system? Explain the fields of expert system.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.
Importance of e-governance:- Because of following points we have to use e-governance.
  • Information delivery is greatly simplified for citizens and businesses.
  • It gives varied departments’ information to the public and helps in decision making.
  • It ensures citizen participation at all levels of governance.
  • It leads to automated services so that all works of public welfare is available to all citizens.
  • It revolutionizes the functions of the government and ensures transparency.
  • Each department and its actions is closely monitored.
  • Public can get their work smartly done and save their time.
  • It provides better services to citizens and brings government close to public. Public can be in touch with the government agency.
  • It cuts middlemen and bribery if any.
                                                            OR
Ans:-
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
etc.
to be more clear about this, let's take an example.
For example:
MYCIN: It was based on backward chaining and could identify various bacteria that could cause acute infections. ... DENDRAL: Expert system used for chemical analysis to predict molecular structure. PXDES: An Example of Expert System used to predict the degree and type of lung cancer
12.Define multimedia. List the advantages and disadvantages 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.
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.
13.Write short notes on :2.5+2.5

a) Digital divide b) Social impact of ICT
Ans:-
a)Digital Divide:-

The digital divide is a problem that affects people from all walks of life. It is a multifaceted issue, but two main characteristics define this gap: access to high-speed internet and access to reliable devices. Many of the individuals who struggle from the digital divide face both.

In some areas, internet access is either limited, unavailable, or unaffordable for those who could be equipped. Even with a reliable internet connection, access to certain digital spaces can remain a challenge, always just out of reach for those who can’t afford costly tools like laptops and software.

This leaves countless students and professionals to rely on public computers or their mobile devices as their only tools to exist in an increasingly digital world. It leaves many more, like those in rural areas or living under the poverty line, without even that.


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

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

15.Write short notes on :

a) Protocol b) Data Security
Ans:-
a)Protocol:-
A communications protocol is a formal description of digital message formats and the rules for exchanging those messages in or between computing systems and in telecommunications. Protocols may include signaling, authentication and error detection and correction capabilities. A protocol describes the syntax, semantics, and synchronization of communication and may be implemented in hardware or software, or both.

We have many examples like http, ftp, stp, tcp/IP etc.

TCP is one of the main protocols in TCP/IP networks. Whereas the IP protocol deals only with packets, TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.

Where as IP specifies the format of packets, also called datagram, and the addressing scheme. Most networks combine IP with a higher-level protocol called Transmission Control Protocol (TCP), which establishes a virtual connection between a destination and a source.
b)Data security:-
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. Besides these all, we can apply different level of securities like:
    1. Physical: - It says about sites where data is stored must be physically secured.
    2. Human: - It is an authorization is given to user to reduce chance of any information leakage or manipulation.
    3. Operating system: We must take a foolproof operating system regarding security such that no weakness in o.s.
    4. Network: - since database is shared in network so the software level security for database must be maintained.
    5. Database system: - the data in database needs final level of access control i.e. a user only should be allowed to read and issue queries but not should be allowed to modify data

                                                                             THE END

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

set B

-----


                                                HSEB-GRADE XII - 2071(2014)

                                                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.Write a program which reads name of 100 students and sort them in alphabetical order.10
Ans:-
#include <stdio.h>
#include<string.h>
struct shorting
{
  char name[100];
}var[100],var1;
int main()
{
    int i,j;
    printf("enter name\n");
    for(i=0;i<=99;i++)
    {
        scanf("%s",var[i].name);
    }
for(i=0;i<=99;i++)
{
    for(j=i+1;j<=99;j++)
    {
        if((strcmp(var[i].name,var[j].name))>0)
        {
            var1=var[i];
            var[i]=var[j];
            var[j]=var1;
        }
    }
}
for(i=0;i<=99;i++)
    {
        printf("name=%s\n",var[i].name);
       
    }
    return 0;
}

2.Describe “Sequence”, “Selection” and “Loop” with flowchart. WAP to check if the number is odd or even?6+4
Ans:-

Sequence: Our program contains many lines of codes or instructions. This says about execution of lines one after another in a sequence or order. While writing program the codes should be in certain sequence to get desired output if not then we may get some like unexpected output. Flowchart can be used to represent like given below.      

FLOWCHART

IN QB,

CLS

a=9

b=8

print “hello”

print a

print b

end

HERE, WE CAN SEE HOW A PROGRAM EXECUTES WRITTEN IN QB. AT FIRST, FIRST LINE GETS EXECUTED THEN SECOND AND SO ON.

SELECTION: THIS LOGICAL PART SAYS ABOUT “SELECTION OF CERTAIN BLOCK OF STATEMENTS/PARTS/” BUT UNDER CERTAIN CONDITION. IN OUR DAILY LIFE ALSO  WE USE THIS CONCEPT, DON’T WE? LET’S TAKE AN EXAMPLE; IF I HAVE RS. 1000 THEN I WOULD DO THIS/THAT, IF NOT, THEN NOTHING I WILL. SO, YOU DO NOT THINK THAT IT’S SIMPLE TO UNDERSTAND ABOUT SELECTION. IN OUR PROGRAM, SOME WHERE WE HAVE TO USE THIS CONCEPT VERY FREQUENTLY. IT CAN BE REPRESENTED BY USING FLOW CHART AS GIVEN BELOW.

A SAMPLE PROGRAM IN QB/C LOOKS LIKE:


QB

{

int a=2;

if(a%2==0)

{

printf(“even”);

}

Else

{

printf(“odd”);

}



we can see here how an execution takes place. At first the condition is tested ,if it is satisfying then many instructions one after another execute and if the condition does not satisfy then other instruction get executed.  

Just like if.... we can use other selection structure like if..else if,switch... etc if there are multiple conditions to be tested or included. they work in same manner as ‘if’ works as shown above.

Iteration (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. With the help of flowchart, we can represent as

flowchart

a simple ‘c’ code

In Programming, we write in following way under body line( in c).

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

{

printf(“%d”,i);

Here, we can see how an execution occurs many times if the condition satisfies(  in same as in flowchart).














In above flowchart or code we can see that there is an entry point ,condition testing and then executing many instructions,this execution just goes on or repeats again and again after checking condition.when the condition becomes false the further movement or execution does not occur and  termination takes place.

For looping, we can use different other statements in same manner like while or do.. while or do...until etc. The working way and syntax are little bit different but we get same output.


second part:-

//'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();
}

3.What is pointer? Describe the benefits of pointer with examples.4+6

Ans:-

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

Benefits:

1.It handles memory effectively.

2.Useful in file handling

3.Reduces spaces.

4.REduces execution time.

Example:

 

#include<stdio.h>

int main()

{

int *k;

int m=90;

k=&m;

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

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

return 0;

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

4.What is an array? Write a program which finds multiplication table of two matrices.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:-
#include <stdio.h>
 
int main()
{
  int m, n, p, q, c, d, k, sum = 0;
  int first[10][10], second[10][10], multiply[10][10];
 
  printf("Enter the number of rows and columns of first matrix\n");
  scanf("%d%d", &m, &n);
  printf("Enter the elements of first matrix\n");
 
  for (  c = 0 ; c < m ; c++ )
    for ( d = 0 ; d < n ; d++ )
      scanf("%d", &first[c][d]);
 
  printf("Enter the number of rows and columns of second matrix\n");
  scanf("%d%d", &p, &q);
 
  if ( n != p )
    printf("Matrices with entered orders can't be multiplied with each other.\n");
  else
  {
    printf("Enter the elements of second matrix\n");
 
    for ( c = 0 ; c < p ; c++ )
      for ( d = 0 ; d < q ; d++ )
        scanf("%d", &second[c][d]);
        for ( c = 0 ; c < m ; c++ )
        {
             for ( d = 0 ; d < q ; d++ )
             {
                 multiply[c][d]=0;
                 for ( k = 0 ; k < p ; k++ )
                {
                 multiply[c][d]+= first[c][k]*second[k][d];
                }
 
                 
             }
        }
 
    printf("Product of entered matrices:-\n");
 
    for ( c = 0 ; c < m ; c++ )
    {
      for ( d = 0 ; d < q ; d++ )
        printf("%d\t", multiply[c][d]);
 
      printf("\n");
    }
  }
 
  return 0;
}

5.Write a program which reads name, roll-number and age from a file named “student.dat” and display them.10
Ans:-
/*program which reads name, roll-number and age from a file named “student.dat” and display them
*/
#include<stdio.h>
int main()
{
  FILE *p;
  char name[100];
  int roll;
float age;
 p=fopen("student.dat","r");
 printf("data are:\n");
 while((fscanf(p,"%s%d%f",name,roll,age))!=EOF)
{
 printf("name=%s  roll=%d and age=%f\n",name,roll,age);
 }
fclose(p);
return 0;
}

                                                                    Group “B”

                                                Short Answer questions 7x5=35


Attempts any Seven questions:
6.Describe different levels 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.
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.Who is system analyst? List out the roles 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.
Roles:-

Defining Requirement: It's very difficult duty of analyst to understand user's problems as well as requirements. some techniques like interview, questioning, surveying, data collection etc have to be used. The basic step for any system analyst is to understand the requirements of the users.
Prioritizing Requirements: Number of users use the system in the organization. Each one has a different requirement and retrieves different information and in different time. For this the analyst must have good interpersonal skill, convincing power and knowledge about the requirements and setting them in proper order of all users.
Gathering Facts, data and opinions of Users: After determining the necessary needs and collecting useful information the analyst starts the development of the system with active cooperation from the users of the system. Time to time, the users update the analyst with the necessary information for developing the system. The analyst while developing the system continuously consults the users and acquires their views and opinions.
Evaluation and Analysis: Analyst analyses the working of the current information system in the organization and finds out extent to which they meet user's needs. on the basis of facts,opinions, analyst finds best characteristic of new system which will meet user's stated needs.
Solving Problems: Analyst is actually problem solver. An analyst must study the problem in depth and suggest alternate solutions to management. Problem solving approach usually has steps: identify the problem, analyse and understand the problem, identify alternate solutions and select best solution.

8.What is RDBMS? List out the functions of RDBMS.1+4
Ans:-
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.

9.Describe “Operators” which are used in C-programming.5
Ans:-
operator:- It is a symbol or a character used in programming. It is used to carry out some operation.
for example: +,-,= etc
Types of operator:-
It is of following types.
1)Arithmetic operator: It is used to do arithmetic calculations/operation.
 It has following types.

 +         -----------> used for addition.example is a+b. It means we are performing addition with the help of operand a and b
-           ------------>It is used for subtraction.Example is a-b.  It means we are performing subtraction with the help of operand a and b
* -------------------->used for multiplication.example is a*b. It means we are performing multiplication with the help of operand a and b
/---------------->used for division.example is a/b. It means we are performing division with the help of operand a and b
%---------------->used for remainder division.example is a%b. It means we are performing division with the help of operand a and b.It gives us remainder after division.

2)relational operator: 
This operator is used to perform comparisons between variables.It supports us to take decision logically. example,x>y ,x>=y etc
Relational operator has following types.


>------> It is used to show greater than. like x>y
>=----->It is used to show greater than or equals to.like x>=y
<-------->It is used to show a variable is smaller than another.like x<y
<=-------> It is used to show smaller than or equals to with another variable.Like x<=y
!=----------> I simply says , two variables are not equal in value.like x!=y
==---------->It says two variables have same value.It is used to test values of two variables.

3)Logical operator:-
                                   This operator is quite helpful when we want to combine multiple  conditions and take decision.It returns values in the form of 0 o 1.It works logically.
Its types are:

3.a)and (&&)-----------> It is called 'and'operator.It is used to combine multiple conditions.It gives us true output if all of them are true otherwise we get false output.
 example:if(a>b && a>c)
                      {
                            display a     
                        }
 we can see here that to be greatest,value of 'a' must be greater than b and c. So we use here '&&'
   
  3.b)or(||):- It is called 'or'operator.It is used to combine multiple conditions.It gives us true output if anyone of them is true or all are true otherwise we get false output.
 example:if(a==90 || b==90 || c==90)
                      {
                            display right angle triangle  
                        }
 we can see here that to be right angled triangle,either 'a'or 'b'or 'c' a must be 90 . So we use here '||'.

3.c) !(not )operator:-
                                It is used to reverse the result.
example
int a=5;
if(!(a==5))
{
printf("it is\n");
}
else
{
printf("it is not\n");
}
here ,the value is 5 but we get output "it is not".It is called reversing the output.

4) Assignment operator:
                                an operator ,symbolized by '=' character,is called assignment operator.It assigns value to variable.
example:
int a=6;
It means, we are assignming value 6 to variable a.

5)Unary operator:- this operator  works on one operand only.It has two types.
                               I) increment operator:- It increases the value of given variable by one.For example: ++y or y++
                                             It can be classified into pre-increment and post increment.
                                                 pre-increment:- It is written as ++x.It means first increase the value and then use that.
                                                 post-increment: It is written as x++.It means, first use that and then increase its value by one.

                               II)decrement operator:- It decreases the value of given variable by one.For example: --y or y--
                                             It can be classified into pre-decrement and post decrement.
                                                 pre-decrement:- It is written as --x.It means first decrease the value and then use that.
                                                 post-decrement: It is written as x--.It means, first use that and then decrease its value by one.


Besides these all, we have some other operators .like  bitwise,


10.What is network? List out the benefits of networks.1+4

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)

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

  • Scalable (computers and devices can be added with time without changing original network.

  • provides distributed and centralized management system for enterprise.

  • increase productivity.

  • cost reduction by sharing one application/hardware etc.

Application of networking in our daily life:

-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

11.Describe the importance of OOP.5
Ans:-
As the name suggests, Object-Oriented Programming or OOPs refers to languages that uses objects in programming. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

  • Abstraction: 
  • Objects: 
  • Class: 
  • Encapsulation: 
  • Information hiding: 
  • Inheritance: I
  • Interface: 
  • Polymorphism: 
  • Procedures are sections of programs tasked with specific jobs.
  • Since it has these features so it is widely used and popular among the developers. and we can not find these features in POP platforms.


    12.Describe computer crime and its various forms.5
    Ans:-
    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. Clicking on any of the links below gives further information about each crime.
    Child pornography - Making or distributing child pornography.
    Cyber terrorism - Hacking, threats, and blackmailing towards a business or person.
    Cyberbully or Cyberstalking - Harassing others online.
    Creating Malware - Writing, creating, or distributing malware (e.g. viruses and spyware.)
    Denial of Service attack - Overloading a system with so many requests it cannot serve normal requests.
    Espionage - Spying on a person or business

    13.What is multimedia? List out the advantages 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.
    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:


    14.Describe the objectives of e-governance.5
    Ans:-
    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.

    15.Write short notes on :

    a) Cyber Law b) Expert System

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

    Cyber law is a new and quickly developing area of the law that pertains to persons and companies participating in e-commerce development, online business formation, electronic copyright, web image trademarks, software and data licenses, online financial transactions, interactive media, domain name disputes, computer software and hardware, web privacy, software development and cybercrime which includes, credit card fraud, hacking, software piracy, electronic stalking and other computer related offenses.
    b)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.
    For example:
    MYCIN: It was based on backward chaining and could identify various bacteria that could cause acute infections. ... DENDRAL: Expert system used for chemical analysis to predict molecular structure. PXDES: An Example of Expert System used to predict the degree and type of lung cancer
    ------------------------------

    set C

    -------




                                                            HSEB-GRADE XII - 2071(2014)

                                                            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.What is function? Write a program to generate factorial of a given number using recursive function2+8
    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:
    //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.Describe any five “file string handling functions” with examples.10
    Ans:-
    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)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.

    Like these all, we have many other string handling functions like, strcat(),strchr(),strdup(),strset() etc.


    3.What is looping? Describe “for”, “while” and “do-while” loops with appropriate examples.1+9

    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:-


    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

    do..while loop:-
    It also executes program statements repeatedly until the given condition is true. It executes the program statements once at first then only condition is checked. If a condition is found true then it executes the program statements again, otherwise it gets out from the loop structure. As it checks the condition at last it is also known as the post-test loop or exit control loop.
    syntax:-
    initialization;
    do
    {

    statements;

    increment/decrement;
    }while(condition);
    Flowchart:-


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

    Output:
    If we execute this we will get 1,2,3....20
    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
    4.Write a program which asks 100 numbers and sort them in ascending order.10
    Ans:-
    /* Write a C program that reads 100 numbers and arrange them in ascending order*/
    #include <stdio.h>
    int main()
    {
        float numbers[100];
        int i,j,k;
        
        printf("Enter numbers\n");
        for(i=0;i<100;i++)
        {
            scanf("%f",&numbers[i]);
        }
        for(i=0;i<100;i++)
        {
            for(j=i+1;j<100;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<100;i++)
        {
            printf("%f\n",numbers[i]);
        }
        return 0;
    }



    5.Write a program to find greatest number among four numbers.10

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



                                                                        Group “B”

                                                    Short Answer questions 7x5=35

    Attempts any Seven questions:
    6.What is system analysis and design? Describe briefly.5
    Ans:-
    System ananlysis:-

    Once the problems identified, it is time to analyze the type of software that could answer the problems encountered. System analysis (may be by system analyst) will take a look at possible software. The goal of a system analysis is to know the properties and functions of software that would answer the concerns solicited from intended users.

                                                         System Analysis would lead in determining the requirements needed in software. These requirements in software should be implemented otherwise the software may not answer the concerns or may  lack in its usage. This stage will somehow determine how the software should function.

                                                                                       It is the study of complete business system or parts of business system and application of information gained from that study to design,documentation and implementation of new or improved system. This field is closely related to operations research. An analyst work with users to determine the expectation of users from the proposed system.

                                                                  The development of a computer-based information system often comprises the use of a systems analyst. When a computer-based information system is developed, systems analysis would constitute the following steps/points.

    • The development of a feasibility study, involving determining whether a project is economically, socially,, technologically, organisationally,legally, schedule feasible.

    • Conducting fact-finding measures, designed to ascertain the requirements of the system's end-users typically interviewing, questionnaires, or visual observations of work on the existing system.

    System Design:-

    In this phase we start design of proposed new system.It describes desired features and operations in detail, including screen layouts, business rules, process diagrams, pseudo code and other documentation. We can use two designing methods namely logical (what is required for IS) and physical (how to achieve requirements). At first we design logical and then it is converted into physical design. A prototype should be developed during the logical design phase if possible. The detailed design phase modifies the logical design and produces a final detailed design, which includes technology choices, specifies a system architecture, meets all system goals for performance, and still has all of the application functionality and behavior specified in the logical design. 

               This design can carry following activities:

    • Defining precisely the required system output

    • Determining the data requirement for producing the output

    • Determining the medium and format of files and databases

    • Devising processing methods and use of software to produce output

    • Determine the methods of data capture and data input

    • Designing Input forms

    • Designing Codification Schemes

    • Detailed manual procedures

    • Documenting the Design

    We can use several tools while designing. They are: Algorithm, Flowchart, Pseudocode, etc. Let’s see in detail about these all designing tools.

    7.What is database? List out the advantages of database management system.1+4
    Ans:-
    Databsae:-
    Database is a collection of data for one or more multiple uses in very well organized format.
    Or
    Simply well organized collection of data is database.
    One way of classifying databases involves the type of content, for example: bibliographic, full-text, numeric, and image. Databases consist of software-based "containers" that are structured to collect and store information so users can retrieve, add, update or remove such information in an automatic fashion. Database programs are designed for users so that they can add or delete any information needed. The structure of a database is tabular, consisting of rows and columns of information.


    Advantages
    • Reduced data redundancy
    • Improved data security
    • Reduced data entry, storage, and retrieval costs
    • Facilitated development of new applications program
    • improved data integrity (integrity:data should be accurate & accurate; it is done by providing some checks
    • multiple users.
      Disadvantages
    • Database systems are complex, difficult, and time-consuming to design
    • Substantial hardware and software start-up costs
    • Initial training required for all programmers and users
    Advantages of 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 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 Network topology? Describe any two network topologies with clear diagram.1+4
    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.


    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


    9.Describe the centralized and distributed database systems.5
    Ans:-
    Following are differences between distributed and centralized database system.


    Centralized system
    Distributed System
    1.Job is centralized.
    1.Job is distributed.
    2. Can not process if main server fails.
    2. Can still be if a server fails;processing can be done by other servers.
    3. Security is given to one machine.
    3.Security is given to all.
    4.No need to have network for communication.
    4 Needs communication channel between all.
    5.Not so expensive to set up.
    5.It’s expensive to set up.
    6.Data speed is comparatively fast.
    6.Data speed is slow.
    7.Low quality performance.

    Diagrammatically it can be shown as



    7.High quality performance.

    Diagrammatically it can shown


    10.Describe the “coaxial cable” and “satellite” with examples.2.5+2.5
    Ans:-
    coaxial cable:-
    • It is an electrical cable with an inner conductor surrounded by a flexible, tubular insulating layer, surrounded by a tubular conducting shield.
    • The term coaxial comes from the inner conductor and the outer shield sharing the same geometric axis.
    • Coaxial cable is used as a transmission line for radio frequency signals, in applications such as connecting radio transmitters and receivers with their antennas, computer network (Internet) connections, and distributing cable television signals and uses many connectors.
    • It is available in two types thin (10base2; means 100 MBPS and upto 200 meter) and thick (10base5 coax;means 10 MBPS, and upto 5oo meter). They are different in diameter and bandwidth. Most of television operators use this. They are obsolete and no longer in use for computer networking

    figure :coaxial cable


    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.

    11.Describe the different data types which are used in C-programming.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.they are
    int,float,double,char

    Integers:- An integer can be a whole number but not a fractional number. It can accept any + ve or –ve number.  It is very common type of data used by computer. When we add/subtract/divide/multiply, we get integer but if output is in fractional, the system just truncates that decimal part and returns only integer part. Like 1+2 yields 3. 3 divided by 2 yields 1. For this data type in some language, we use some suffix like % or word like ‘int’.

                      

    Floating part:- If we are going to write a program which includes some like fraction type of data then we use this data type. Like, 1.23, -.34.45 etc. the computers recognize the real numbers having fractions easily and processes accordingly. For float type of data, we use some words like ‘float’ and some where suffix like ! or #.

                                

                            

    Character type:- Simply a letter or a number or space or any other symbol which we use in program is called character. A single character is placed in a single quote like ‘a’ or ‘,’ or ‘1’ etc. but, if we combine many characters then we put inside double quote like “computer”, it has 8 characters. For this type, we use reserved word like ‘char’ in C and some where it is not needed.

                                

                           String type: A data type which contains many characters together and mostly put inside double quote (in most language) is called string. Like “computing” or “education” etc. for this, we use reserved word char with some index value. In C, we can write char name[20];. Here name is a string type of data and holds up to 20 characters.


    Double:-  
    This data type is used for exponential values and for more accuracy of digits.It's working range is more than others. so if we want to use long numbers of any type and high accuracy then...? for example,
       data type variable;
    double ab;
    'ab' is a variable of double type. It can store exponential values (3x104). It ca n be written as 3e+4 or 3E+4. If power is in negative form then it can be in 3e-4 or 3E-4. It has one advantage over others that it can be used in place of others easily.
    12.What is OOP? List the advantages 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.
    Advantages of OOP:-
    • Modularity for easier troubleshooting. Something has gone wrong, and you have no idea where to look. ...
    • Reuse of code through inheritance. ...
    • Flexibility through polymorphism. ...
    • Effective problem solving.

    13.Describe the applications areas of AI.5
    Ans:-
    Application areas:-
    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
    .

    14.Describe the advantages of multimedia.5

    Ans:-
    Following are some advantages of multimedia.
    We can use:
    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) E-commerce b) Normalization

    Ans:-
    a)E-commerce :-
    Ans:-
    E-commerce is a transaction of buying or selling online. Electronic commerce draws on technologies such as mobile commerceelectronic funds transfersupply chain managementInternet marketingonline transaction processingelectronic data interchange (EDI), inventory management systems, and automated data collection systems. Modern electronic commerce typically uses the World Wide Web for at least one part of the transaction's life cycle although it may also use other technologies such as e-mail.
    E-commerce businesses may employ some or all of the following:
    • Online shopping web sites for retail sales direct to consumers
    • Providing or participating in online marketplaces, which process third-party business-to-consumer or consumer-to-consumer sales
    • Business-to-business buying and selling
    • Gathering and using demographic data through web contacts and social media
    • Business-to-business (B2B) electronic data interchange
    • Marketing to prospective and established customers by e-mail or fax (for example, with newsletters)
    • Engaging in pretail for launching new products and services
    • Online financial exchanges for currency exchanges or trading purposes


    b) Normalization
    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




    1 comment:

    1. All Slots | Online Casinos
      With a xo 카지노 progressive jackpot, you're 카지노싸이트 sure to get a better 온라인포커 chance of winning. We've got everything you need 룰렛 만들기 to be ready to dive into the world's 토토 사이트 제작 biggest slot

      ReplyDelete