NEB year 2070 computer science questions
Set A
Time: 3 hrs
Full Marks : 75
Pass Marks: 27
Group “A”
Long Answer questions 4x10=40
Attempts any Four questions:
1.Write a program which finds the sum, difference and product of two numbers using switch case statement.10
2.Describe the types of loop with flowchart and example.10
3.Write a program which asks the user to input “n” terms of number and find out the greatest and smallest number among those numbers.10
4.Differentiate between array and structure with suitable examples.5+5
5.Write a program which asks name, age, roll number of students and write them in a file “xyz.dat”.10
Group “B”
Short Answer questions 7x5=35
Attempts any Seven questions:
6.Explain SDLC with appropriate diagram.5
7.Explain the database models with clear diagrams.5
8.What is DBMS? List out the functions of DBMS.1+4
9.Define computer networks and explain their uses.1+4
10.Describe simplex, half duplex and full duplex channel of communication with examples.5
11.What is operator? Describe the types of operators with appropriate examples.1+4
12.What is OOP? List out the advantages of multimedia system.1+4
13.What is multimedia? List out the advantages of multimedia system.1+4
14.What is AI? Explain the application areas of AI.1+4
15.List out the advantages and disadvantages of e-business.5
--------------------------------------------------------------------------------
Answers:-
--------------------
Group “A”
Long Answer questions 4x10=40
Attempts any Four questions:
1.Write a program which finds the sum, difference and product of two numbers using switch case statement.
Ans:-
//WAP to find sum,difference, and product of two numbers using switch.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int choice;
int a,b,output;
printf("please enter your two numbers for a and b for operation\n");
scanf("%d%d",&a,&b);
printf("'now,we have following menu\n");
printf( "1.to get sum\n");
printf("2. to get difference\n");
printf("3 to get product\n");
printf(" any other number to exit");
printf("enter your choice 1 or 2 or 3 or any other number\n");
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("we are going to get sum\n");
printf("the sum=%d",a+b);
break;
case 2:
printf("we are going to get difference \n");
printf("the difference=%d",a-b);
break;
case 3:
printf("we are going to get product,\n");
printf("the product=%d",a*b);
break;
default:
printf("sorry, not a valid input\n");
printf("thank u, terminating....\n");
}
getch();
}
2.Describe the types of loop with flowchart and example.
Ans:-
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:-
initialization;
do
{
statements;
increment/decrement;
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:-
for(initialization;condition;increment/decrement )
{
statements;
}
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
Ans:-
4.Differentiate between array and structure with suitable examples.5+5
Ans:-
Array | struct |
---|---|
1.It stores same type of data | 1. It stores dis-similar type of data. |
2.It uses static memory allocation . | 2.I uses dynamic memory allocation. |
3.It takes less time to access elements. | 3.It takes more time to access elements. |
4.It uses index value to access elements. | 4.It takes help of period operator(.) to access elements. |
5.It is derived data type. | 5. IT is user's defined data type. |
6.We can not define array of array. | 6.We can define array of structure. |
7.Its syntax is data type identifier[value]; example,int a[20]; | 7.Its syntax is struct tag {datatype member1; datatype member2; data type member3; }variable; example, struct det {char name[100]; char add[40]; int roll; }variable; |
5.Write a program which asks name, age, roll number of students and write them in a file “xyz.dat”.10
Ans:-
Group “B”
Short Answer questions 7x5=35
Attempts any Seven questions:
6.Explain SDLC with appropriate diagram.5
Ans:-
SDLC is a structure or a process to develop a software followed by a development team within the software organization. It consists of a detailed plan describing how to develop, maintain and replace specific software. SDLC is also known as information systems development or application development. It is life cycle defining a methodology for improving the quality of software and the overall development process.
Why SDLC:-
When business organization facing a keen competition in the market, rapid change of technology and fast internal demand, system development is necessary. In the system development, a business organization could adopt the systematic method for such development. Most popular system development method is system development life cycle (SDLC) which supports the business priorities of the organization, solves the identified problem, and fits within the existing organizational structure. And obviously software can be very difficult and complex. We need the SDLC as a framework to guide the development to make it more systematic and efficient
In summarized form we can say following reasons for SDLC.
I. To create a better interface between the user and the system.
II. For good accuracy and speed of processing.
III. High security and backup of data used in system.
IV. Sharing of data all over the world in very less and real time.
V. new laws that force organizations to do new things, or do old things differently
VI. changes in society, such as growing demand for better security over personal data
VII. a desire to improve competitiveness in the fact of reducing profits and market share
7.Explain the database models with clear diagrams.5
Ans:-We hahve many database models like, hierarchical,network,relational,E-R model, etc.Here we are going to understand about two.
Three key terms are used extensively in relational database models: relations, attributes, and domains. A relation is a table with columns and rows. The named columns of the relation are called attributes, and the domain is the set of values the attributes are allowed to take.
The basic data structure of the relational model is the table, where information about a particular entity is represented in columns and rows. Thus, the "relation" in "relational database" refers to the various tables in the database; a relation is a set of tuples.So,
Relational databases
Data is organized into two-dimensional tables, or relations
Each row is a tuple (record) and each column is an attribute (field)
A common field appears in more than one table and is used to establish relationships
Because of its power and flexibility, the relational database model is the predominant design approach
In this table we have used different concept like field (each column),record (each row). Each row gives us a complete information. If we have many tables then we relate them for data extractions,this is called relationship between tables.Apart from these, we also use other concept like,primary key,foreign key,Entity etc.
E-R model(E-R diagram):
The Entity-Relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects, called entities, and of relationships among these objects. An entity is a “thing” or “object” in the real world that is distinguishable from other objects. For example, each person is an entity, and bank accounts can be considered as entities.
Entities are described in a database by a set of attributes. For example, the attributes account-number and balance may describe one particular account in a bank, and they form attributes of the account entity set. Similarly, attributes customer-name, customer-street address and customer-city may describe a customer entity.
A relationship is an association among several entities. For example, a depositor relationship associates a customer with each account that she has. The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively.
The overall logical structure (schema) of a database can be expressed graphically by an E-R diagram, which is built up from the following components:
Rectangles, which represent entity sets
Ellipses, which represent attributes.
Diamonds, which represent relationships among entity sets.
Lines, which link attributes to entity sets and entity sets to relationships.
for example,
1)
8.What is DBMS? List out the functions of DBMS.1+4
Ans:-
Database Management System (DBMS):-It’s a set of computer programs that controls the creation, maintenance, and the use of the database with computer as a platform or of an organization and its end users.
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 et
9.Define computer networks and explain their uses.1+4
Ans:-
Networking:
A 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
10.Describe simplex, half duplex and full duplex channel of communication with examples.5
Ans:-
11.What is operator? Describe the types of operators with appropriate examples.1+4
Ans:-
for example: +,-,= etc
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
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.
12.What is OOP? List out the advantages of OOP.1+4
Ans:-
- 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.
Multimedia:-
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:
Ans:-
15.List out the advantages and disadvantages of e-busines.
Ans:-
24/7 Availability
Your website is an invaluable e-business tool. There is no e-business model or e-business owner that does not have a website. Having your website opens the door to more business advantages.
Global Reach
Through the internet, you can reach a worldwide audience for your product or service. There are no physical restrictions on a specific geographical region that you see with a traditional business.
Disadvantages:-
Innovation Pressure
With an e-business model, it exposes you to a global competitive field, and there is a tendency for your brand’s voice to be drowned out in a sea of several thousand competitors. This situation leads to constant pressure to innovate. Be innovative to get and keep your customers; otherwise, you lose out to the competition. It would help if you also innovated your supply chain to meet your customers’ expectations.
Cost and Shipping
Factors such as exchange rate, taxes and shipping might sometimes make your product unaffordable for your consumers living in another geographical location.
After considering these issues, if you still wish to go ahead with your e-business, here is an infographic with 5 Tips for an Efficient E-Business to help you out.
set B
HSEB-GRADE XII - 2070(2013)
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.What is control statement? Describe “Sequence”, “Selection” and “Loop” with flowchart and examples.2+8
Ans:-
1. 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.
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:
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
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.
Ans:-/*
3.Differentiate between structure and union with suitable examples.5+5
ans:-
struct | Union |
1.It stores dis-similar data.Each gets separate space in memory.They do not share memory | 1. It stores dis-similar type of data.Total memory space is equal to the member with largest size.They share memory space. |
2.we can access member in any sequence . | 2.We can access that whose value is recently used. |
3.It uses keyword 'struct' | 3.It uses keyword 'union' |
4.We can initialize values of member/s and in any order | 4.We can initialize that member which is first declared. |
5.It consumes more memory | 5.It consumes less memory. |
6.Its syntax struct tag { datatype member1; datatype member2; datatype member3; }variable; | 6.Its syntax union tag { datatype member1; datatype member2; datatype member3; }variable; |
Example struct student { int roll; char sex; float percentage; }var; | Example union student { int roll; char sex; float percentage; }var; |
4.What is recursion? Write a program to calculate factorial value of given number using recursive function.2+8
Ans:-
All recursive algorithms must have the following:
Base Case (i.e., when to stop)
Work toward Base Case
Recursive Call (i.e., call ourselves.
#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);
}
}
5.Write a program which reads name, department and age from a file named “employee.dat” and display them.10
Ans:-
Group “B”
Short Answer questions 7x5=35
Attempts any Seven questions:
6.What is system? Explain the basic elements of system.1+4
Ans:-
Similarly an 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.
An Information system(computerised system) carries following characteristics:-
· Organization: implying structure and order.
· Interaction :-refers procedure in which in which each component functions with other units.
· Interdependence:-means that one component of the system depending on others.
· Integration: - saying how a system is tied together. it is more than just sharing a physical part.
· Central objective: - is quite common that an organization may set one objective and operative together to achieve together. Since it is a common goal for all the units or components so all the users or units have to be aware about this.
Basic elements:-
Hardware:-It is a physical component of a computer. Example :Monitor,keyboard etc
Software:It is the collection of programs. It runs the system. Example:O.S.
Process:It is the procedure which helps the computer to perform a task
7.Who is system analyst? List out the roles of system analyst.1+4
Ans:-
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.
Ans:-
No. |
DBMS |
RDBMS |
1) |
DBMS
applications store data as file. |
RDBMS
applications store data in a tabular form. |
2) |
In DBMS,
data is generally stored in either a hierarchical form or a navigational
form. |
In RDBMS,
the tables have an identifier called primary key and the data values are
stored in the form of tables. |
3) |
Normalization
is not present in DBMS. |
Normalization
is present in RDBMS. |
4) |
DBMS
does not apply any security with regards to data manipulation. |
RDBMS defines
the integrity constraint for the purpose of ACID (Atomocity,
Consistency, Isolation and Durability) property. |
5) |
DBMS uses
file system to store data, so there will be no relation between the
tables. |
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. |
6) |
DBMS has to
provide some uniform methods to access the stored information. |
RDBMS
system supports a tabular structure of the data and a relationship between
them to access the stored information. |
7) |
DBMS does
not support distributed database. |
RDBMS supports
distributed database. |
8) |
DBMS is
meant to be for small organization and deal with small data. it
supports single user. |
RDBMS is
designed to handle large amount of data. it supports multiple users. |
9) |
Examples of
DBMS are file systems, xml etc. |
Example of
RDBMS are mysql, postgre, sql server, oracle etc. |
9.Describe the data types which are used in C programming.5
Ans:-
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.
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,
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.
Ans:-
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.
- 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
11.Explain polymorphism and inheritance with examples.2.5+2.5
Ans:-
12.Describe compute crime and its various forms.1+4
Ans:-
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
Ans:-
Advantages of Multimedia
- It is very user-friendly. It doesn’t take much energy out of the user, in the sense that you can sit and watch the presentation, you can read the text and hear the audio.
- It is multi sensorial. It uses a lot of the user’s senses while making use of multimedia, for example hearing, seeing and talking.
- It is integrated and interactive. All the different mediums are integrated through the digitisation process. Interactivity is heightened by the possibility of easy feedback.
- It is flexible. Being digital, this media can easily be changed to fit different situations and audiences.
- It can be used for a wide variety of audiences, ranging from one person to a whole group.
Disadvantages of Multimedia
- Information overload. Because it is so easy to use, it can contain too much information at once.
- It takes time to compile. Even though it is flexible, it takes time to put the original draft together.
- It can be expensive. As mentioned in one of my previous posts, multimedia makes use of a wide range of resources, which can cost you a large amount of money.
- Too much makes it unpractical. Large files like video and audio has an effect of the time it takes for your presentation to load. Adding too much can mean that you have to use a larger computer to store the files.
14.What are the objectives of e-governance? Explain.5
Ans:-
The objectives of e governance are as follows-
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.
a) Normalization b) Expert System
Ans:-
a)Normalization:-
---------------------------------------------------------------------------------------------------------
Set C
HSEB-GRADE XII - 2070(2013)
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 nested loop? Write a program to display the multiplication table of nth terms of given numbers.2+8
Ans:-
We can write an entire loop structure inside another loop structure. So a loop inside another loop is called a nested loop.
Syntax:
for(initialization; condition ; increment/decrement)
{
for(initialization; condition ; increment/decrement)
{
statements;
}
}
#include<stdio.h>
#include<conio.h>
void main()
{
int k,n;
printf("enter value of 'n'th term\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(k=1;k<=10;k++)
{
printf("%d\n",i*k);
}
printf("\n");
}
getch();
}
Ans:-
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));
}
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.Describe array, structure and pointer with examples.10
Ans:-
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.
b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values.
|
Column zero |
Column one |
Row 0 à |
1(0,0) |
2(0,1) |
Row 1à |
3(1,0) |
4(1,1) |
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.
Features:
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.Write a program which reads salary of 25 employees and count the number of employees who are getting salary between 30,000 to 40,000.10
Ans:-
5.Describe fprintf and fscanf file handling functions. Write a program which writes “Welcome to Nepal” in a file.10
Ans:-
syntax:-
syntax:-
Short Answer questions 7x5=35
Attempts any Seven questions:
6.What is feasibility study? Explain different levels of feasibility study.1+4
Ans:-
It has following types.
7.What is Hierarchical database model? List out the advantages and disadvantages of Hierarchical database model.1+4
Ans:-
Hierarchical database is a model in which data is organized into a tree-like structure. In this,
Data is organized like a family tree or organization chart
The parent record can have multiple child records – child records can only have one parent
Pointers link each parent record with each child record
Complex and difficult to maintain
This structure allows one 1:N relationship between two types of data. This structure is very efficient to describe many relationships in the real world; recipes, table of contents, ordering of paragraphs/verses,
Example:
We can see here a parent node with many branches called children.Each child has their own record with furhher informations.In given diagram, the first record has name “Ram” with street “Baneshwor” and city named kathmandu. It is further linked to its balance id and amount. In same fashion all others records have, they all are related or linked to their id and amount. We can see records’ arrangement in tree like format.
Advantages:- 1) easiest model of database.
2) Searching is fast if parent is known.
3) supports one to many relationship.
Disadvantages: 1) old and outdated one.
2) Can not handle many to many relationships.
3) More redundancy.
8.What is networking? List out the advantages and disadvantages of networking.1+4Ans:-
A 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)
- Sharing devices such as printers saves money.
- Site (software) licences are likely to be cheaper than buying several standalone licences.
- Files can easily be shared between users.
- Network users can communicate by email and instant messenger.
- Security is good - users cannot see other users' files unlike on stand-alone machines.
- Data is easy to backup as all the data is stored on the file server.
1.Purchasing the network cabling and file servers can be expensive.
2.Managing a large network is complicated, requires training and a network manager usually needs to be employed.
3.If the file server breaks down the files on the file server become inaccessible. Email might still work if it is on a separate server. The computers can still be used but are isolated.
4.Viruses can spread to other computers throughout a computer network.
5.There is a danger of hacking, particularly with wide area networks. Security procedures are needed to prevent such abuse, eg a firewall.
Ans:-
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 |
Ans:-
- 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
- Unshielded Twisted pair cabling is a type of wiring in which two conductors (the forward and return conductors of a single circuit) are twisted together for the purposes of canceling out electromagnetic interference (EMI) from external sources; for instance, electromagnetic radiation from unshielded twisted pair (UTP) cables, and crosstalk between neighboring pairs. Different pairs(colour) have different function.It has 4-pairs of copper wires.
- UTP cable is also the most common cable used in computer networking. Modern Ethernet, the most common data networking standard, utilizes UTP cables.
- Twisted pair cabling is often used in data networks for short and medium length connections because of its relatively lower costs compared to optical fiber and coaxial cable.
- It has bandwidth up to 100mbps but can be increased up to 10000 mbps.
- The rate at which signal moves is ⅔ of velocity of light.
- It is available in different categories like CAT5,CAT6 ,CAT7 etc
11.Differentiate between “While” and “Do-While” loop with flowchart.2.5+2.5
Ans:-
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: 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. |
Ans:-
13.What is AI? Explain the application areas of AI.1+4
Ans:-
14.What are the components of multimedia? Explain.5
Ans:-
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.
a) E-learning b) Data dictionary2.5+2.5
Ans:-
------------------------------------
Best merit casino【VIP】nba free spins
ReplyDeleteBest free casino【VIP】nba free spins casino【VIP】nba free spins febcasino casino,nba free spins casino,nba free spins 메리트 카지노 주소 casino,nba free spins 메리트 카지노 casino,nba free
Baccarat Site - Jeff's Don Rausch
ReplyDeleteBaccarat site, near the entrance to 메리트 카지노 쿠폰 the casino at the 바카라 주소 Borgata 퍼스트 카지노 Hotel Casino, has been opened for the 온라인 바카라 사이트 first time since opening 바카라 사이트 추천 in 1990.