-->

NEB year 2075 computer science questions and solutions

 Year 2075  computer science questions

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

                                        Group-A      (4x10=40)                                               

(Long Questions answers)
q1. a)What is loop? Differentiate between while and do while loop.(2+3)
       b) Define the terms class and object [5] 
q2 Write a program to input 10 integer numbers into an array and display the sum of the number[10]
q3. What is function? Explain any four string functions with example. [2+8]
q4. Write a program to input name, roll and regno of 10 student's using structure and display in proper format[10]
q5.What is normalization? Explain first second and third normal form with example. [2+8]

Group-B (short questions) (7x5=35)
Attempt any seven questions:
6. Who is system analyst? Explain the role of system analyst. [1+4]
7. Define the terms DFD and E-R diagram. [2.5x2]
8. Differentiate between centralized and distributed database. [5]
9. Differentiate between peer-to-peer and client/server network. [5]
10. What is transmission media? Write advantages of optical fiber cable.[1+4]
11. What are the importance of OOP? [5]
12 Define the terms e-business and learning. [2.5x2]
13. Explain the social impact of ICT. [5]
14. What is multimedia? List the components of multimedia, [1+4]
15. Write short notes on:(2.5x2) 
a) AI b) WiFi

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

Answer:

    Group-A      (4x10=40)                                               

(Long Questions answers)
q1. a)What is loop? Differentiate between while and do while loop.(2+3)
Ans:-
      Loop:-
Looping is the process of executing the same program statement or block of program statements repeatedly for a specified number of times or till the given condition is satisfied.
It helps us to solve complex program,patterns easily.
It is of different types: while, do..while,for ,nested loop
 Difference between while and do...while loop:

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) Define the terms class and object [5] 
Ans:-
class:-
In the real world, you'll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles. A class is the blueprint from which individual objects are created. So it can be said as collection of same type of objects.
class sample:
class name
{
private:
data members;
public:
member functions;
};
object:-
An object can be considered a "thing" with some attributes and can perform a set of related activities. The set of activities that the object performs defines the object's behavior. For example, the hand can grip something or a Student(object) can give the name or address. They all have state and behavior. like ,Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes).
q2 Write a program to input 10 integer numbers into an array and display the sum of the number[10]
Ans:-
// to input 10 elements and to print their sum
#include<stdio.h>
int main()
{
 int array[100];
 int i;
 int sum=0;
printf("enter elements\n");
for(i=0;i<=9;i++)
 {
  scanf("%d",&array[i]);
  sum=sum+array[i];
  }
 printf("array's elements' sum is=%d\n",sum);
 
return 0;
}


q3. What is function? Explain any four string functions with example. [2+8]
Ans:-
Function:-
Definition: 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
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

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.

four string handling functions:-
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.

q4. Write a program to input name, roll and regno of 10 student's using structure and display in proper format[10]
Ans:-
/* 
C program to input name,roll and regno.  of 10 students 
and print them 
*/
#include <stdio.h>
struct students
{
  char name[100];
  int roll;
  int regno;
}var[10];
int main()
{
    int i,j;
    printf("enter name,roll and regno\n");
    for(i=0;i<=9;i++)
    {
        scanf("%s",var[i].name);
        scanf("%d",&var[i].roll);
        scanf("%d",&var[i].regno);
    }

for(i=0;i<=9;i++)
    {
        printf("name=%s roll=%d and regno=%d\n",var[i].name,var[i].roll,var[i].regno);
       
    }
    return 0;
}

q5.What is normalization? Explain first, second and third normal form with example. [2+8]
Ans:-
Normalization:-
In the field of relational database design, normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain undesirable characteristics—insertion, update, and deletion anomalies that could lead to a loss of integrity.

1 NF:

        

A TABLE IS SAID TO BE IN 1n IF there is not repeating groups or information in a table..Here, repeating group means a set of columns that stores similar information that repeats in the same table.

Let’s consider following SQL commands.

Create table contacts

(

Contact Id               Integer                    not null,

L_name                  varchar(20)            not null,

F_name                  varchar(20)           

Contact_date1      date,

Contact_desc1      varchar(50),

Contact_date2      date,

Contact_desc2      varchar(50),

);

We can see here in this table that there is a repeating group of date and description.

Now to convert into 1 N, we have to make a new table and shift that repeating group into new table.

Like,

Create table contacts

(

Contact_ID integer        not null,

L_name      varchar(20) not null,

F_name      varchar(20)

);

 

Create table conversation

(

Contact_id integer        not null,

Contact_date date,

Contact_desc        varchar(50)

);


2N:

A table is said to be in 2 N if it is in 1N and there is no redundant data in table i.e. if a value of column is dependent on one column(primary key only) but not another.

For example:

Create table employee

(

Emp_no     integer        not null,

L-name       varchar(20) not null,

F_name      varchar(20),

Dept_code integer,

Description varchar(50),

);

This table contains redundant data i.e. the value of column(field) “description” depends on dept_code but does not depend on primary key “emp_no”.So let’s make a new table and shift them into that.

Create table employee

(

Emp_no     integer        not null,

L_name      varchar(20) not null,

F_name      varchar(20),

Dept_code integer,

);

 

Create table department

(

Dept_code integer        not null,

Description varchar(50) not null,

);

We got two tables named employee and department with fields. Both the tables are related by primary key called dept_code. Now there is no redundancy and table is in 2N.


3N:-

An entity is said to be in the third normal form when,

1) It satisfies the criteria to be in the second normal form.

2) There exists no transitive functional dependency. (Transitive functional dependency can be best explained with the relationship link between three tables. If table A is functionally dependent on B, and B is functionally dependent on C then C is transitively dependent on A and B).

Example:

Consider a table that shows the database of a bookstore. The table consists of details on Book id, Genre id, Book Genre and Price. The database is maintained to keep a record of all the books that are available or will be available in the bookstore. The table of data is given below.

Book id

Genre id

Book genre

price

121

2

fiction

150

233

3

travel

100

432

4

sports

120

123

2

fiction

185

424

3

travel

140

The data in the table provides us with an idea of the books offered in the store. Also, we can deduce that BOOK id determines the GENRE id and the GENRE id determines the BOOK GENRE. Hence we can see that a transitive functional dependency has developed which makes certain that the table does not satisfy the third normal form.

Book id

Genre id

price

121

2

150

233

3

100

432

4

120

123

2

185

424

3

140


                                                                           table book

Genre id

Book genre

2

fiction

3

travel

4

sports


                                                                           table genre

After splitting the tables and regrouping the redundant content, we obtain two tables where all non-key attributes are fully functional dependent only on the primary key.

When all the column in a table describe and depend upon the primary key,the table is 3N.

Group-B (short questions) (7x5=35)

<span face="roboto, sans-serif" style="color: #555555; letter-spacing: normal; white-space: pre-wrap;"> </span>Attempt any seven questions:
6. Who is system analyst? Explain the role 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.

7. Define the terms DFD and E-R diagram. [2.5x2]
Ans:-
DFD:

A data flow diagram (DFD) is a design tool to represent the flow of data through an information system. With a dataflow diagram, developers can map how a system will operate, what the system will accomplish and how the system will be implemented. It is implemented in 1 and 2 level. Whereas at 0 level , it is context diagram. We can use different symbol like:

  1. Rectangle----->entities or data source

  2. rectangle with process no. and description and doer name side by--------> shows about processes and number

  3. open rectangle with identifier and name where to store -------------> storing somewhere,may be electronic media or a database.

  4. arrow:- shows about movement of data/flow

DFD operates in three levels namely DFD-0,DFD-1 and DFD-2.
Let's have an example of DFD-0.

DFD-0 level:-

   


E-R diagram:-
The Entity-Relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. An entity is a “thing” or “object” in the real world that is distinguishable from other objects. For example, each person is an entity, and bank accounts can be considered as entities.
Entities are described in a database by a set of attributes. For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. Similarly, attributes customer-name, customer-street address and customer-city may describe a customer entity.
A relationship is an association among several entities. For example, a depositor relationship associates a customer with each account that she has. The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively.
The overall logical structure (schema) of a database can be expressed graphically by an E-R diagram, which is built up from the following components:
  • Rectangles, which represent entity sets
  • Ellipses, which represent attributes.
  • Diamonds, which represent relationships among entity sets.
  • Lines, which link attributes to entity sets and entity sets to relationships.

for example,

8. Differentiate between centralized and distributed database. [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

9. Differentiate between peer-to-peer and client/server network. [5]
Ans:-
Lets understand client-server and peer-to-peer networking with the help of following description .

They are types of networking on the basis of architecture:
Peer to peer(P2P):
  • In this all the computers are treated equally.
  • No one computer is server or client.
  • All computers can be said working as client or server.
  • Computers have self processing capability and do not rely on others.
  • Computers have or can run with normal operating system like, XP, Me etc and application.
  • Easy sharing of files and allows us to have chatting.
  • failure of one does not mean others are down; networking goes on.
  • If heavy load is given, they may not give same performance. etc
  • low level security.
Client –server:
  • In this, one or two computers work as server and left all work as clients.
  • Clients computers give request to server for a task to be performed.
  • Clients computers may or may not have self processing capability. they rely on server.
  • Mostly servers use a powerful operating system like, Linux or Unix or Win advanced server2008 etc.
  • Through server, the sharing of files is done.
  • Everything is controlled by server so in the case of down, services can not be completed.
  • under heavy load, many servers share the tasks.
  • there is high level security in networking.
  • High traffic towards servers while processing.
10. What is transmission media? Write advantages of optical fiber cable.[1+4]
Ans:-
Transmission media:-
A transmission medium is something that can mediate the propagation of signals for the purposes of telecommunication. Signals are typically imposed on a wave of some kind suitable for the chosen medium.
or we can also say,The transmission medium can be defined as a pathway that can transmit information from a sender to a receiver. Transmission media are located below the physical layer and are controlled by the physical layer. Transmission media are also called communication channels.
Advantages of optical fiber cable:-
  • Better bandwidth. Fibre optic cables have much greater bandwidth than metal cables. ...
  • Higher bandwidth means faster speed. ...
  • Longer transmission distances. ...
  • Greater flexibility. 
  • Improved latency. 
  • Stronger security.

11. What are 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 Define the terms e-business and learning. [2.5x2]
    Ans:-
    e-business:-
    Online Business or e-business is any kind of business or commercial transaction that includes sharing information across the internet. Commerce constitutes the exchange of products and services between businesses, groups, and individuals and can be seen as one of the essential activities of any business.
    The following are the different types of e-commerce platforms: 
    Business-to-Business (B2B) 
    Business-to-Consumer (B2C) 
    Consumer-to-Consumer (C2C) 
    Consumer-to-Business (C2B)

    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.

    13. Explain the social impact of ICT. [5]
    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


    Negative impacts in society:

    1.Spamming

    Spamming refers to sending unwanted emails in bulk, which provide no purpose and needlessly obstruct the entire system. Such illegal activities can be very frustrating for you as it makes your Internet slower and less reliable.

    2.Virus Threat:

    Internet users are often plagued by virus attacks on their systems. Virus programs are inconspicuous and may get activated if you click a seemingly harmless link. Computers connected to Internet are very prone to targeted virus attacks and may end up crashing.
    14. What is multimedia? List the components of multimedia, [1+4]
    Ans:-
    Multimedia:-
    Multimedia is content that uses a combination of different content forms such as text, audio, images, animations, video and interactive content. Multimedia contrasts with media that use only rudimentary computer displays such as text-only or traditional forms of printed or hand-produced material.
    Components:-

    1)Text: Text is the most common medium of representing the information. In multimedia, text is mostly use for titles, headlines,menu etc. The most commonly used software for viewing text files are Microsoft Word, Notepad, Word pad etc. Mostly the text files are formatted with ,DOC, TXT etc extension.

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

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

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

    5)Animation: In computer animation is used to make changes to the images so that the sequence of the images appears to be moving pictures. An animated sequence shows a number of frames per second to produce an effect of motion in the user's eye.
    15. Write short notes on:(2.5x2) 
    a) AI b) WiFi
    Ans:-
    A.I:-
    Artificial intelligence is where machines can learn and make decisions similarly to humans. There are many types of artificial intelligence including machine learning, where instead of being programmed what to think, machines can observe, analyse and learn from data and mistakes just like our human brains can. This technology is influencing consumer products and has led to significant breakthroughs in healthcare and physics as well as altered industries as diverse as manufacturing, finance and retail. In part due to the tremendous amount of data we generate every day and the computing power available, artificial intelligence has exploded in recent years. We might still be years away from generalised AI—when a machine can do anything a human brain can do—, but AI in its current form is still an essential part of our world.
    Some AI related system in our society:

    • Artificial Intelligence Influences Business
    • Life-Saving AI
    • Entertaining AI
    • e-mail communications
    • self driving cars and buses
    • Navigation
    • web searchingetc
    Wi-Fi:-
    Wi-Fi is the wireless technology used to connect computers, tablets, smartphones and other devices to the internet. Wi-Fi is the radio signal sent from a wireless router to a nearby device, which translates the signal into data you can see and use.
    Internet connectivity occurs through a wireless router. When you access Wi-Fi, you are connecting to a wireless router that allows your Wi-Fi-compatible devices to interface with the Internet.
    It works using access point.What a wireless access point does for your network is similar to what an amplifier does for your home stereo. An access point takes the bandwidth coming from a router and stretches it so that many devices can go on the network from farther distances away. But a wireless access point does more than simply extend Wi-Fi. It can also give useful data about the devices on the network, provide proactive security, and serve many other practical purposes.
    --------------------------------
    Thanks to sources:
    cisco.com
    wikipedia.org
    plkcomputersir.blogspot.com/2021/06/xii-past-question-paper.html
    opticalsolutions.com.au
    and all others.

    No comments:

    Post a Comment