-->

HISSAN year 2068 computer science questions and solutions

 

HISSAN CENTRAL EXAMINATION – 2068 (2012)

COMPUTER SCEINCE [230-M]

Time: 3 hrs                                                                                                       Full  Marks : 75

                                                                                                                          Pass Marks: 27





                                                                        Group “A”

                                                    Long Answer questions 4x10=40
Attempts any Four questions:

1.What is data type? List some data types. Write a program that accepts Principle and Time then calculates the simple interest according to the following rates:

Duration                                                                        Interest Rate

Up to 6 Months                                                                8%

Up to 12 Months                                                                9%

Up to 18 Months                                                            9.5%

Up to 5 Years                                                                10.5%

More than 5 Years                                                        12%

Ans:-
  Data types:-
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


Second part:-
/*
program that accepts Principle and Time then calculates
the simple interest according to the following rates:

Duration            Interest Rate

Up to 6 Months      8%

Up to 12 Months     9%

Up to 18 Months     9.5%

Up to 5 Years       10.5%

More than 5 Years   12%
*/

#include <stdio.h>

int main()
{
    float p,t,r,SI;
    printf("Enter principle,and time in month \n");
    scanf("%f%f",&p,&t);
    if(t<=6)
    {
        SI=p*t*8/100;
    }
    else if(t>6&& t<=12)
    {
        SI=p*t*9/100;
    }
    else if(t>12&& t<=18)
    {
        SI=p*t*9.5/100;
    }
    else if(t>18&& t<=60)
    {
        SI=p*t*10.5/100;
    }
    else
    {
         SI=p*t*12/100;
    }
    printf("Simple interest=%f",SI);
    return 0;
}


2.What is function in C? What are the different ways of using a function? Write a C program to display largest number among three numbers using a function max( ). This function takes the value of three numbers as arguments and returns the largest number among these numbers.
Ans:-
Function:-
A self –contained block of code that performs a particular task is called Function.


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.
Advantages 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.
6.It keeps our code well organized.
7.It makes the code re-usable
etc
Different ways of using function:-

There are four methods to use functions:-


1. FUNCTION WITH NO ARGUMENTS AND NO RETURN VALUES:-This user defined function uses no arguments and returns no value.Let's take an example to understand about this.

#include<stdio.h>

void sum();

int main()

{

    sum();

    return 0;

}

void sum()

{

 printf("sum of two numbers =%d",2+4);

}

In this we have not passed any arguments and no return value in function prototype and in body part.This is the simpalest way to use function. To call , simply we have to put function name inside the main() function.


2.FUNCTION WITH NO ARGUMENTS AND RETURNING SOME VALUES:

This user defined function uses no arguments and returns some value.For this we have to take other data type than void for  function.Let's take an example to understand about this.

#include<stdio.h>

int sum();

int main()

{

    printf("sum=%d",sum());

    return 0;

}

int sum()

{

    int a=4,b=5;

int c;

c=a+b;

 return c;

}

In this we have not passed any arguments but it is returning some valeu of integer data type.For this we have used int data type in function prototype and in body part.This is the alternative methd to use function. Since the call is  of integer type we have to use printff() with %d specifier to print the value/output.


3.FUNCTION WITH ARGUMENTS AND RETURNING NO VALUES.

This user defined function uses some arguments/variables and returns no value.For this we have to take  void data tyep for  function.Let's take an example to understand about this.

#include<stdio.h>

void sum(int,int);

int main()

{

   sum(3,5);

    return 0;

}

void sum(int a,int b)

int c;

c=a+b;

printf("sum=%d",c);

}

In this we have  passed two arguments a and b and it is  returning no value.For this we have used void data type in function prototype and in body part. when the function is called, we have passed two values 3 and 5 as real arguments. These values are copied to variables a and b and are used inside the body part of function. To print the value/output we simply use function name inside the main().


4.FUNCTION WITH ARGUMENTS AND RETURN VALUES.

This user defined function uses some arguments/variables and returns some value.For this, we have to take  other data type than than void data type for  function.Let's take an example to understand about this.

#include<stdio.h>

int sum(int,int);

int main()

{

  printf("sum is %d", sum(3,5));

    return 0;

}

int sum(int a,int b)

int c;

c=a+b;

return c;

}

In this we have  passed two arguments a and b and it is  returning an integer value value.For this we have used int data type in function prototype and in body part. when the function is called, we have passed two values 3 and 5 as real arguments. These values are copied to variables a and b and are used inside the body part of function. To print the value/output we simply use function name with specifier %d with printf() function inside the main().


Third part:-
// program to get greatest number among three numbers
#include<stdio.h>
#include<conio.h>
int max(int,int,int);
void main()
{
int a,b,c;
printf(“enter three numbers\n”);
scanf(“%d%d%d”,&a,&b,&c);
printf("greatest number=%d",max(a,b,c));
return 0;
}
int max(int a,int b,int c)
{
if(a>b &&a>c)
{
return a;
}
elseif(b>a &&b>c)
{
return b;
}
else
{
return c;
}
getch();
}


3.Why data file is necessary in programming? Discuss the various modes of data files. Write a C program to delete a record. (Assume that the record has roll, name and address field. And asked the roll number for deleting the record.)
Ans:-
Datafile necessity:-
A data file is a computer file which stores data to be used by a computer application or system, including input and output data. A data file usually does not contain instructions or code to be executed (that is, a computer program). Most of the computer programs work with data files.

Mode of datafiles:-
There are many modes for opening a file:
  • r - open a file in read mode.
  • w - opens or create a text file in write mode.
  • a - opens a file in append mode.
  • r+ - opens a file in both read and write mode.
  • a+ - opens a file in both read and write mode.
  • w+ - opens a file in both read and write mode.
Third part:-
#include<stdio.h>
int main()
{
 int roll,roll_deleted;
char name[100];
char address[100];
 FILE *k,*k1;
k=fopen("student.dat","r");
k1=fopen("temp.dat","w");
printf("enter roll number to be deleted\n");
scanf("%d",&roll_deleted);
while((fscanf(k,"%d %s %s",&roll,name,address))!=EOF)
{
  if(roll==roll_deleted)
  {
  printf("this record has been deleted\n");
  }
  else
  {
  fprintf(k1,"%d %s %s\n",roll,name,address);
}
}
fclose(k);
fclose(k1);
printf("data updated!!!!\n");
remove("student.dat");
rename("temp.dat","student.dat");
return 0;
}

4.What is structure? How it differs from an array? Write a program to accept name and address of Nth numbers of students and arrange them on descending order according to the name.
Ans:-
With the help of following paragraphs, we can understand and differentiate between struct and array.
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 takes help of period operator(.) to access elements.We can define array of structure.
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;

Array:-
.It stores same type of data.It uses static memory allocation .It takes less time to access elements.It uses index value to access elements.It is derived data type.We can not define array of array.  Its syntax is                                          
data type identifier[value];
example,int a[20];

Second part:-
/* 
C program to input name and adress n number of students and print them
in descending order and on the basis of name.
*/
#include <stdio.h>
#include<string.h>
struct shorting
{
  char name[100];
  char address[100];
}var[200],var1;
int main()
{
    int i,j,n;
    printf("enter total size of data\n");
    scanf("%d",&n);
    printf("enter name and address\n");
    for(i=0;i<n;i++)
    {
        scanf("%s",var[i].name);
        scanf("%s",var[i].address);

    }
for(i=0;i<n;i++)
{
    for(j=i+1;j<n;j++)
    {
        if((strcmp(var[i].name,var[j].name))<0)
        {
            var1=var[i];
            var[i]=var[j];
            var[j]=var1;
        }
    }
}
for(i=0;i<n;i++)
    {
        printf("name=%s address=%s\n",var[i].name,var[i].address);
       
    }
    return 0;
}





5.
a) Differentiate between while and do while loop.
Ans:-

Differences between while and do..while loop 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 in C that reads the age of 100 persons and count the number of person in the age group 15-25.

Ans:-
/*Write a C program to enter age of 100 persons and count the number of person in the age group 15-25.
*/
#include <stdio.h>
int main()
{
    float age[100];
    int i,count=0;
    printf("enter age of 100 persons\n");
    for(i=0;i<=99;i++)
    {
        scanf("%f",&age[i]);
         if(age[i]>=15 && age[i]<=25)
         count++;
    }
    
      printf("%f,",count);
    
    return 0;
}




                                                                Group “B”

                                            Short Answer questions 7x5=35


Attempts any Seven questions:
6.What is information system? Explain the different types of information system.

Ans:-
Information system:-
Information system is an arrangement of people, data, processes information presentation and information technology that interacts to support and improve day to day operation in a business as well as support the problem solving and decision making needs of management.

Following are some types:
1)Trasnaction Information System
2)MIS
3)Executive Information System
4.Decision Support system
etc

1.)Transaction Information System:-

A transaction processing system is a type of information system. TPSs collect, store, modify, and retrieve the transactions of an organization. A transaction is an event that generates or modifies data that is eventually stored in an information system by using four major units namely input,storage,processing and output.

It has several advantages:

.Rapid response

.more reliable

2.)Management Information system (MIS):-

Management Information Systems (MIS) is the study of people, technology, organizations and the relationships among them. MIS professionals help firms realize maximum benefit from investment in personnel, equipment, and business processes. MIS is a people-oriented field with an emphasis on service through technology.

It has numerous advantages,

  1. Improves personal efficiency

  2. Expedites problem solving(speed up the progress of problems solving in an organization)

  3. Facilitates interpersonal communication

  4. Promotes learning or training

7.What is SDLC? List different stages of SDLC and explain any three stages.

Ans:-
SDLC:-

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




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

Planning:-

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

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

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

                                             We can apply techniques like:

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

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

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

2) Getting the idea about context of problem

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

                   

Analysis:-

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.
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.
8.What is Artificial Intelligence? Explain its application areas.
Ans:-
Artificial Intelligence:-
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.

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

9.What is database file? Differentiate it with DBMS. List some advantages and limitations of DBMS.
Ans:-
We can understand dabase and DBMS with the help of following paragraphs.
Database:-

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

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.



10.What is e-commerce? What value does it bring to the business? List the types of 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 in business:-

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

Types of e-commerce:- e-commerce is of following types.
1.B2B
2.B2C
3.C2C
4.C2B
5.B2A
etc.

11.What do you mean by object oriented programming structure? Discuss how it differs from procedural oriented programming structure.
Ans:-
object oriented programming structure:-
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.
It differs from procedure Oriented Programming in following aspects. 


  • Abstraction: 
  • Objects: 
  • Class: 
  • Encapsulation: 
  • Information hiding: 
  • Inheritance:
  • When we talk about POP, it carries following properties.
    1.Top-down method
    2.Data moves freely
    3.Data can not be hidden
    4.Uses functions as major unit
    5.No polymorphism concept
    6.No Data encapsulation concept


    12.What is networking? Explain the different types of communication channels.
    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)


    Second part:-
    There are two types of communication channels,Guided and unguided.Let's know about them.
    Guided channel:
    The signal energy propagates through wires in guided media.Guided media is used for point to point communication.Discrete network topologies are formed by the guided media.Signals are in the form of voltage, current or photons in the guided media.Examples of guided media are twisted pair wires, coaxial cables, optical fiber cables.By adding more wires, the transmission capacity can be increased in guided media.

    Unguided channel:-
    The signal energy propagates through air in unguided media.Unguided media is generally suited for radio broadcasting in all directions.Continuous network topologies are formed by the unguided media.Signals are in the form of electromagnetic waves in unguided media.Examples of unguided media are microwave or radio links and infrared light.It is not possible to obtain additional capacity in unguided media.

    13.What is digital divide? What are the social impacts of ICT in society?
    Ans:-
    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.Write short notes on any two:

    a) Virtual reality b) E-learning c) Multimedia and its application
    Ans:-
    a) Virtual reality:-
                            Virtual Reality (VR) is a computer-generated environment with scenes and objects that appear to be real, making the user feel they are immersed in their surroundings. This environment is perceived through a device known as a Virtual Reality headset or helmet.
    Virtual reality or VR is a technology that creates a virtual environment. People interact in those environments using, for example, VR goggles or other mobile devices. It is a computer-generated simulation of an environment or 3-dimensional image where people can interact in a seemingly real or physical way.

    b) E-learning:-
                            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.
                    

    c) Multimedia and its application:-
                                                        Multimedia is content that uses a combination of different content forms such as text, audio, images, animations, video and interactive content. Multimedia contrasts with media that use only rudimentary computer displays such as text-only or traditional forms of printed or hand-produced material.
    We can use multimedia in following fields.
    Following are some advantages of Multimedia:-
    1)Multimedia in Education: 
    2)Multimedia in Entertainment: 
    3)Movie Industry
    4)Gaming
    5)Journalism
    6)Engineering
    7)Animation
    etc


    THE END

    2 comments:

    1. Casino No Deposit Bonus Codes 2021
      Claim our 피망바카라시세 exclusive Casino Bonus Codes! Our list of top no deposit bonuses for 2021 includes: 1. Red 화이트 벳 Dog e 스포츠 토토 Casino Bonus – 갤럭시 카지노 $1,000 + 20 Free Spins (only $5 for slots). 카지노 톡

      ReplyDelete
    2. Slot Machines - CasinoFansGambling
      You can play slot machines 엠카지노에오신것을환영합니다 on 우리 카지노 계열 this website, but there is a lack of casino gambling apps available, as well as other forms of 온라인 카지노 게임 gambling. 카지노 사이트 Slot machines are 토토 폴리스

      ReplyDelete