SET -10
HISSAN
CENTRAL EXAMINATION – 2071 (2015) COMPUTER
SCEINCE [230-D2] |
|||||||||||||||||||||||||||
Time: 3 hrs Full Marks : 75 Pass
Marks: 27 |
|
||||||||||||||||||||||||||
Group
“A” Long
Answer questions
4x10=40 |
|||||||||||||||||||||||||||
Attempts any Four questions: 1.What do you mean by operator? What are the operators used in C language? Explain with examples.2+8 ans:- operator:- It is a symbol or a character used in programming. It is used to carry out some operation. for example: +,-,= etc Types of operator:- It is of following types. 1)Arithmetic operator: It is used to do arithmetic calculations/operation. It has following types. + -----------> used for addition.example is a+b. It means we are performing addition with the help of operand a and b - ------------>It is used for subtraction.Example is a-b. It means we are performing subtraction with the help of operand a and b * -------------------->used for multiplication.example is a*b. It means we are performing multiplication with the help of operand a and b /---------------->used for division.example is a/b. It means we are performing division with the help of operand a and b %---------------->used for remainder division.example is a%b. It means we are performing division with the help of operand a and b.It gives us remainder after division. 2)relational operator: This operator is used to perform comparisons between variables.It supports us to take decision logically. example,x>y ,x>=y etc Relational operator has following types. >------> It is used to show greater than. like x>y >=----->It is used to show greater than or equals to.like x>=y <-------->It is used to show a variable is smaller than another.like x<y <=-------> It is used to show smaller than or equals to with another variable.Like x<=y !=----------> I simply says , two variables are not equal in value.like x!=y ==---------->It says two variables have same value.It is used to test values of two variables. 3)Logical operator:- This operator is quite helpful when we want to combine multiple conditions and take decision.It returns values in the form of 0 o 1.It works logically. Its types are: 3.a)and (&&)-----------> It is called 'and'operator.It is used to combine multiple conditions.It gives us true output if all of them are true otherwise we get false output. example:if(a>b && a>c) { display a } we can see here that to be greatest,value of 'a' must be greater than b and c. So we use here '&&' 3.b)or(||):- It is called 'or'operator.It is used to combine multiple conditions.It gives us true output if anyone of them is true or all are true otherwise we get false output. example:if(a==90 || b==90 || c==90) { display right angle triangle } we can see here that to be right angled triangle,either 'a'or 'b'or 'c' a must be 90 . So we use here '||'. 3.c) !(not )operator:- It is used to reverse the result. example int a=5; if(!(a==5)) { printf("it is\n"); } else { printf("it is not\n"); } here ,the value is 5 but we get output "it is not".It is called reversing the output. 4) Assignment operator: an operator ,symbolized by '=' character,is called assignment operator.It assigns value to variable. example: int a=6; It means, we are assignming value 6 to variable a. 5)Unary operator:- this operator works on one operand only.It has two types. I) increment operator:- It increases the value of given variable by one.For example: ++y or y++ It can be classified into pre-increment and post increment. pre-increment:- It is written as ++x.It means first increase the value and then use that. post-increment: It is written as x++.It means, first use that and then increase its value by one. II)decrement operator:- It decreases the value of given variable by one.For example: --y or y-- It can be classified into pre-decrement and post decrement. pre-decrement:- It is written as --x.It means first decrease the value and then use that. post-decrement: It is written as x--.It means, first use that and then decrease its value by one. Besides these all, we have some other operators .like bitwise, 2.What is array? List its advantages. WAP to find the sum of elements of 3x3 matrix.2+8 ans:- Definition: A composite variable capable of holding multiple data of same data type under a single variable name is called array. advantages: ->helps us to store multiple values ->helps to solve complex porblem ->can be used as array as pointer ->pixel based graphics programming made easier etc Declaration of Array/syntax: datatype array_name [size]; Example: - int marks [10]; int x[4]={1,2,3,4}; Array size is fixed at the time of array declaration. Generally, we use for loop () to assign data or item in memory and also use this loop to extract data from memory location. Types of Array: There are 2 types of array. a) One Dimensional Array (1-D): IT is an array where we use one subscript value.It stores value in row in contigous cells. syntax: data type arra[value/size]; For example: int a[10]; This array stores ten value starting from location zero na dends at 9. b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values. In this we use matrix concept. syntax: data type arra[row size][column size]; For example: int a[2][2]; It uses two rows and two columns. Values are stored as:
This array stores total four values starting from location zero and ends at 1. Second part:- /* to find sum of two 3x3 matrices*/ #include <stdio.h> int main() { int matrix1[3][3],matrix2[3][3]; int i,j; printf("enter elements of matrix 1\n"); for(i=0;i<=2;i++) { for(j=0;j<=2;j++) { scanf("%d",&matrix1[i][j]); } } printf("enter elements of matrix 2\n"); for(i=0;i<=2;i++) { for(j=0;j<=2;j++) { scanf("%d",&matrix2[i][j]); } } printf("sum of two matrices is \n"); for(i=0;i<=2;i++) { for(j=0;j<=2;j++) { printf(" %d ",matrix1[i][j]+matrix2[i][j]); } printf("\n"); } return 0; } 3.What is file handling function? Write a program to write and read ID and name of employee and display the same from the data file in appropriate format using fsacnf() and fprintf() function.2+8 Ans:- File handling function:- It is the library function which are used to handle data or record stored in a datafile. Its main functions are: ->to store data ->to read data from a datafile ->to append more data ->to update or delete data ->It helps us to create buffer area inside RAM to use that ->To delete data file and rename them Second part:- /* a program to write and read ID and name of employee and display the same from the data file in appropriate format using fsacnf() and fprintf() function.*/ #include <stdio.h> { int id; char name[100]; int i; FILE *p; p=fopen("emp.dat","w"); printf("enter id and name \n"); for(i=0;i<=9;i++) { scanf("%d",&id); scanf("%s",name);
fprintf(p,"%d %s \n",id,name); } fclose(p); p= p=fopen("emp.dat","r"); for(i=0;i<=9;i++) { fscanf(p,"%d %s ",id,name); printf("id=%d,name=%s \n",id,name); } fclose(p); return 0; } 4.What is Union and Structure? Write a C program to input name and age of 10 patient and arrange them in ascending order to the name.2+8 Ans:- The differences between struct and union are given below in tabular form.
5.Explain local, global and static local variables with suitable example. Write a program to find sum of first N natural numbers. The value of N should enter by user. Ans:- Local variables:-
Those variables which are declared
inside the function are called local variables.They can not be accessed from
other function or outsiders. It means scope is limited to that function
where it is declared. For local variables, either we use keyword 'auto'
or simply variables with data types.
Example:-
void sum()
{
int a,b;
int sum;
}
Here, a,b and sum are local variables.
Global variables:-
Those variables which are declared
outside the function are called global variables.They can be accessed
from other function or outsiders. It means scope is not limited to that
function. For global variables, either we use keyword 'extern' or simply
variables with data types.
Example:-
int a=7,b=9;
int sum;
void sum()
{
sum=a+b;
}
Here, a,b and sum are global variables.
Once we declare them , it does not need to be declared inside the function. It
works.
static variables:-
Compiler can know the value of variables till it is called.After calling
compiler loses its content i.e. function forgets the value. i.e. our function
can not retain its value after calling. To overcome this problem, we have to
use keyword 'static' with variables. It retains the variables values even after
calling.
Example:-
#include <stdio.h>
void sum();
int main()
{
sum();
sum();
return 0; }
void sum() { int
a=7,b=9;
printf("sum is=%d\n",a+b); b++; }
If we run this program, we will get 16 two
times. It means there will be no change in output of statement 'b++'. For this
we have to use static in front of int a=7,b=9 i.e. static int a=7,b=9. If
we use it then computer remembers old values and we will get different values. Now we will get
first 16 then 17 Second part- | |||||||||||||||||||||||||||
5+5 |
|||||||||||||||||||||||||||
Group
“B”
Short Answer questions 7x5=35 |
|||||||||||||||||||||||||||
Attempts any Seven questions: 6.What is feasibility study? Explain the importance of technical and economical feasibility.1+4 Ans:- Feasibility study: It is the measure and the study of how beneficial the development of the system would be to the organization. This is known as feasibility study. The aim of the feasibility study is to understand the problem and to determine whether it is worth proceeding. Components of feasibility study:- 1.Technical feasibility: - This is concerned with availability of hardware and software required for the development of system.The issues with can be like: 1.1) Is the proposed technology proven and practical? 1.2)the next question is: does the firm possess the necessary technology it needs. Here we have to ensure that the required technology is practical and available. Now, does it have required hardware and software? 1.3)The Last issue is related to availability of technical expertise. In this case, software and hardware are available but it may be difficult to find skilled manpower. 2.Operational feasibility:- It is all about problems that may arise during operations. There are two aspects related with this issue: 2.1) what is the probability that the solution developed may not be put to use or may not work? 2.1) what is the inclination of management and end users towards solutions? Besides these all some more issues; a) Information: saying to provide adequate, timely, accurate and useful information to all categories of users. b) Response time, it says about response about output in very fast time to users. c) Accuracy: A software system must operate accurately. It means, it should provide value to its users. It says degree of software performance. d) Services:- The system should be able to provide reliable services. e)Security:- there should be adequate security to information and data from frauds. f) Efficiency: The system needs to be able to provide desirable services to users. 3) Economic feasibility: - It is the measure of cost effectiveness of the project. The economic feasibility is nothing but judging whether the possible benefit of solving the problem is worthwhile or not. Under "cost benefit analysis", there are mainly two types of costs namely, cost of human resources and cost of training. The first one says about salaries of system analysts, software engineers, programmers, data entry operators etc. whereas 2nd one says about training to be given to new staffs about how to operate a newly arrived system. 4) Legal feasibility: - It is the study about issues arising out the need to the development of the system. The possible consideration might include copyright law, labor law, antitrust legislation, foreign trade etc. Apart from these all we have some more types: behaviour feasibility, schedule feasibility study etc. 7.What is DBA? Explain the major role and responsibilities of DBA.1+4 Ans:- DBA:- A database administrator (DBA) is a person/s who is/are responsible for the environmental aspects/activities related to database. The role of a database administrator has changed according to the technology of database management systems (DBMSs) as well as the needs of the owners of the databases. Duties/roles: 1. Installation of new software. 2. Configuration of hardware and software with the system administrator 3. Security administration 4. Data analysis 5. Database design (preliminary 6. Data modeling and optimization 7. Responsible for the administration of existing enterprise databases and the analysis, design, and creation of new databases 8.What do you mean by OSI model of networking? Explain the different layers of OSI model.1+4 Ans:- OSI model:- The OSI, or Open System Interconnection, model defines a networking framework for implementing protocols in seven layers. Control is passed from one layer to the next, starting at the application layer in one station, and proceeding to the bottom layer, over the channel to the next station and back up the hierarchy. ---------------------->Application (Layer 7)
----------------------->Presentation layer (layer 6):-
------------------------>Session (Layer 5)
----------------------->Transport (Layer 4)
------------------------->Network (Layer 3)
------------------------>Data Link (Layer 2)
------------------------->Physical (Layer 1)
9.What is network database model? Compare network database model with hierarchical database model.1+4 Ans:-We can compare both the models with the help of following points. Network database model:- he network model organizes data using two fundamental constructs, called records and sets. The Network Model
eg. We have taken same example as mentioned above.but the records are arranged in graph like structure. In this we do not use concept of child /parent.In given diagram the records are linked to each other with a solid line as it is in hierarchical. Two records namely Ramesh and Hary are linked to two balance id and amounts. Advantages:- 1) more flexible due to many to many relationship. 2) Reduction of redundancy. 3) Searching is very fast. Disadvantages:- 1) very complex. 2) Needs long and complex programs. 3) Less security Hierarchical model:- Hierarchical database is a model in which data is organized into a tree-like structure. In this,
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. 10.Write short notes on any two:2.5+2.5 a) Digital divide b) Cyber Law c) Virtual Reality Ans:- a) Digital divide:- Interaction between human and computers has greatly increased as we embark on the twenty-first century. The ability to access computers and the internet has become increasingly important to completely immerse oneself in the economic, political, and social aspects of not just America, but of the world. However, not everyone has access to this technology. The idea of the "digital divide" refers to the growing gap between the underprivileged members of society, especially the poor, rural, elderly, and handicapped portion of the population who do not have access to computers or the internet; and the wealthy, middle-class, and young Americans living in urban and suburban areas who have access. b) Cyber Law:- This law is commonly known as the law of the internet. It governs the legal issues of computers, Internet, data, software, computer networks and so on. These terms of legal issues are collectively known as cyberspace. In other words, it is a type of law which rules on the Internet to prevent Internet related crime. Cyber law is a new and quickly developing area of the law that pertains to persons and companies participating in e-commerce development, online business formation, electronic copyright, web image trademarks, software and data licenses, online financial transactions, interactive media, domain name disputes, computer software and hardware, web privacy, software development and cybercrime which includes, credit card fraud, hacking, software piracy, electronic stalking and other computer related offenses. c) Virtual Reality:- Virtual reality is a new computational paradigm that redefines the interface between human and computer becomes a significant and universal technology and subsequently penetrates applications for education and learning. Application fields of Virtual reality Virtual Reality in the Military: A virtual reality simulation enables them to do so but without the risk of death or a serious injury. They can re-enact a particular scenario, for example engagement with an enemy in an environment in which they experience this but without the real world risks. Virtual Reality in Education: Education is another area which has adopted virtual reality for teaching and learning situations. The advantage of this is that it enables large groups of students to interact with each other as well as within a three dimensional environment. Virtual Reality in Healthcare: Healthcare is one of the biggest adopters of virtual reality which encompasses surgery simulation, phobia treatment, robotic surgery and skills training. Virtual Reality in Business: Many businesses have embraced virtual reality as a cost effective way of developing a product or service. For example it enables them to test a prototype without having to develop several versions of this which can be time consuming and expensive. 11.Differentiate between For and While loop with suitable examples of each.5 ans:- We can understand about for and while loop with the help of following paragraphs. for loop:- It is the most common type of loop which is used to execute a program statement or block of program statements repeatedly for a specified number of times. It is a definite loop. Mainly it consists of three expressions: initialization, condition and increment / decrement. The initialization defines the loop starting point, condition defines the loop stopping points and counter helps to increment and decrement the value of counter variable. Syntax of for Loop: for(initialization;condition;increment/decrement ) { statements; } Flowchart:- Example:- #include<stdio.h> int main() { int i; for(i=1;i<=5;i++) { printf("%d,",i); } return 0; } Output:- It prints 1,2,3,4 and 5 While loop:- 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 12.What is OOP? Define Polymorphism and Encapsulation.1+4 Ans:- OOP:- The major motivating factor in the invention of object oriented is to remove some of the flaws encountered in the procedural oriented approach. Object oriented programming uses concept of “Object” and treats data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the functions that operate on it, and protects it from accidental modifications from outside functions. Some features are:- 1) Emphasis is on data rather than procedures or algorithms. 2) Programs are divided into what are known as objects. 3) Data structures are designed such that characterize the objects. Polymorphism :- Its an important OOPs concept , Polymorphism means taking more than one forms .Polymorphism gives us the ultimate flexibility in extensibility. The ability to define more than one function with the same name is called Polymorphism.Polymorphism allows the programmer to treat derived class members just like their parent class’s members. More precisely, Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to calls of methods of the same name .If a Dog is commanded to speak(), this may elicit a bark(). However, if a Pig is commanded to speak(), this may elicit an oink(). Each subclass overrides the speak() method inherited from the parent class Animal.
example is:
Simple example of Polymorphism, look at an Account (it may be checking or saving assuming each attract different dividends) you walk in a bank and ask a teller what is my balance? or dividends? you don't need to specify what kind of an account you're having he will internally figure out looking at his books and provide you the details. Encapsulation:- The wrapping up of data and functions into a single unit is called as encapsulation . Encapsulation means putting together all the variables (Objects) and the methods into a single unit called Class.The class acts like a container encapsulating the properties. It can be described as a protective barrier that prevents the code and data being randomly accessed by other code defined outside the class. Access to the data and code is tightly controlled by an interface.For example the class car has a method turn () .The code for the turn() defines how the turn will occur . So we don’t need to define how Mercedes will turn and how the Ferrari will turn separately . turn() can be encapsulated with both. 13.What are the components of multimedia? Explain them.5 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. 14.What is E-commerce? Explain the advantages of E-learning over traditional learning method.1+4 Ans:- E-commerce:- E-commerce (electronic commerce) is the buying and selling of goods and services, or the transmitting of funds or data, over an electronic network, primarily the internet. These business transactions occur either as business-to-business (B2B), business-to-consumer (B2C), consumer-to-consumer or consumer-to-business. The terms e-commerce and e-business are often used interchangeably. The term e-tail is also sometimes used in reference to the transactional processes that make up online retail shopping. Second part:- 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. Advantages:- 1.Physical presence is not needed 2.Geographically we can be anywhere 3.saves time and money 4.Can be shared with friends 5.It is effective THE END | |||||||||||||||||||||||||||
|
SET -11
HISSAN
CENTRAL EXAMINATION – 2071 (2015) COMPUTER
SCEINCE [230-M3] |
|||||||||||||||||||||||||||
Time: 3 hrs Full
Marks : 75
Pass Marks: 27 |
|
||||||||||||||||||||||||||
Group
“A” Long
Answer questions
4x10=40 |
|||||||||||||||||||||||||||
Attempts any Four questions: 1.What is selection statement? Explain the syntax and semantics of if else statement. Write a program to enter three different integer numbers and find smallest among three different numbers.1+3+6 Ans:- Selection statement: 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. second part:- IF ELSE STATEMENTThis is another form of selective control structure which can handle both expected as well as unexpected situations. In this control structure, statements written in the body part of if are executed if the condition is true otherwise statements written in the body part of else are executed. This is appropriate where we have to check only one condition.Syntax of if else statement: if(condition) statement1; else statement2; In this case if the condition is true then statement1 is executed otherwise statement2 is executed. The else portion of the if-else statement is optional. Flowchart:- Example:- #include <stdio.h> int main() { int num1,num2; printf("Input two numbers"); scanf("%d%d",&num1,&num2); if(num1>num2) printf("%d is greater than %d",num1,num2); else printf("%d is greater than %d",num2,num1); return 0; } Third part:- /*to pick the smallest number among three numbers*/ #include<stdio.h> #include<conio.h> void main() { int x,y,z; printf("enter 3 numbers\n"); scanf("%d%d%d",&x,&y,&z); if(x<y && x<z) { printf("x is smallest"); } elseif(y<x && y<z) { printf("y is smallest\n"); } else { printf("z is smallest"); } getch(); } Array: Definition: A composite variable capable of holding multiple data of same data type under a single variable name is called array. Features: ->stores multiple values ->helps to solve complex porblem ->can be used as array as pointer ->pixel based graphics programming made easier etc Declaration of Array/syntax: datatype array_name [size]; Example: - int marks [10]; int x[4]={1,2,3,4}; Array size is fixed at the time of array declaration. Generally, we use for loop () to assign data or item in memory and also use this loop to extract data from memory location. Types of Array: There are 2 types of array. a) One Dimensional Array (1-D): IT is an array where we use one subscript value.It stores value in row in contigous cells. syntax: data type arra[value/size]; For example: int a[10]; This array stores ten value starting from location zero na dends at 9. b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values. In this we use matrix concept. syntax: data type arra[row size][column size]; For example: int a[2][2]; It uses two rows and two columns. Values are stored as:
This array stores total four values starting from location zero and ends at 1. Second part:- /* to find sum of two 3x3 matrices*/ #include <stdio.h> int main() { int
matrix1[3][3],matrix2[3][3]; int i,j; printf("enter
elements of matrix 1\n");
for(i=0;i<=2;i++) {
for(j=0;j<=2;j++) {
scanf("%d",&matrix1[i][j]); } } printf("enter
elements of matrix 2\n");
for(i=0;i<=2;i++) {
for(j=0;j<=2;j++) {
scanf("%d",&matrix2[i][j]); } } printf("sum
of two matrices is \n");
for(i=0;i<=2;i++) {
for(j=0;j<=2;j++) {
printf(" %d ",matrix1[i][j]+matrix2[i][j]); }
printf("\n"); } return 0; } Ans:- Local variables:- Those variables which are declared inside the function are called local variables.They can not be accessed from other function or outsiders. It means scope is limited to that function where it is declared. For local variables, either we use keyword 'auto' or simply variables with data types. Example:- void sum() { int a,b; int sum; } Here, a,b and sum are local variables.
Global variables:- Those variables which are declared outside the function are called global variables.They can be accessed from other function or outsiders. It means scope is not limited to that function. For global variables, either we use keyword 'extern' or simply variables with data types. Example:- int a=7,b=9; int sum; void sum() { sum=a+b; } Here, a,b and sum are global variables. Once we declare them , it does not need to be declared inside the function. It works. static variables:- Compiler can know the value of variables till it is called.After calling compiler loses its content i.e. function forgets the value. i.e. our function can not retain its value after calling. To overcome this problem, we have to use keyword 'static' with variables. It retains the variables values even after calling. Example:- #include <stdio.h> void sum(); int main() { sum(); sum(); return 0; } void sum() { int a=7,b=9; printf("sum is=%d\n",a+b); b++; } If we run this program, we will get 16 two times. It means there will be no change in output of statement 'b++'. For this we have to use static in front of int a=7,b=9 i.e. static int a=7,b=9. If we use it then computer remembers old values and we will get different values. Now we will get first 16 then 17 Second part-/* a program to find sum of first N natural numbers.*/ //A program to find sum of 1 to n natural numbers. #include<stdio.h> #include<conio.h> void main() { int k=1,n,sum=0; printf("enter value of 'n'\n"); scanf("%d",&n); while(k<=n) { sum=sum+k; k++; } printf("sum of N natural numbers =%d",sum); getch(); } 4.Differentiate between structure and union. Write a program to read age of 50 peoples and count number of people between ages 30 to 50.5+5 Ans:- The differences between struct and union are given below in tabular form.
Second part:- /* program to read age of 50 peoples and count number of people between ages 30 to 50*/ /*Write a C program to enter age of 50 people and count number
of people between 30 and 50. */ #include <stdio.h> int main() { float age[50]; int I,count=0; printf("enter
age of 50 persons\n");
for(i=0;i<=49;i++) {
scanf("%f",&age[i]); } printf("Persons having age between 30
and 50 are:");
for(i=0;i<=49;i++) { if(age[i]>=30
&& age[i]<=50) count++; } printf("total
age between 30 and 50 =%d,"count); return 0; } 5.List any four file handling functions. Write a program to increase the salary of employee by 20% in the file “employee.dat”. Suppose the record of employee have three fields: employ_id, name and salary.2+8 Ans:- Following are four file handling functions. 1.fopen(): It is used to opne a file in particular mode. 2.fclose():It closes the file. 3.fprintf():It is used to write our data or records in a a datafile. 4.fscanf():-It help us to read the contents from a datafile. Second part:- //to update/increase salary by 20% #include<stdio.h> int main() { int employ_id; char name[100]; float salary,updated_sal; FILE *k,*k1; k=fopen("employee.dat","r"); k1=fopen("second.dat","w"); while((fscanf(k,"%d %s
%f",&employ_id,name,&salary))!=EOF) {
updated_sal=salary+0.2*salary; fprintf(k1,"%d
%s %f\n",employ_id,name,updated_sal); } fclose(k); fclose(k1); printf("data updated!!!!\n"); remove("employee.dat"); rename("second.dat","employee.dat"); return 0; } | |||||||||||||||||||||||||||
Group
“B”
Short Answer questions
7x5=35 |
|||||||||||||||||||||||||||
Attempts any Seven questions: 6.What is feasibility study? Explain the importance of feasibility study in system analysis phase.1+4 Ans:- It is the measure and the study of how beneficial the development of the system would be to the organization. This is known as feasibility study. The aim of the feasibility study is to understand the problem and to determine whether it is worth proceeding. A well-researched and well-written feasibility study is critical when making "Go/do not Go" decisions regarding entry into new businesses. why feasibility study?
· Definition of proposed operations/management structure and management method 7.What is ICT? Explain the positive impacts of ICT in society.1+4Ans:- 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. 8.What is network topology? Explain star topology with neat and clean diagram.1+4 Ans:- Network topology: Network topology is the arrangement of the elements of a communication network. Network topology can be used to define or describe the arrangement of various types of telecommunication networks, including command and control radio networks, industrial fieldbusses and computer networks. Basically, ring topology is divided into the two types which are Bidirectional and Unidirectional. Most Ring Topologies allow packets to only move in one direction, known as a one-way unidirectional ring network. Others allow data to go, either way, called bidirectional.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
Disadvantages of a Star Topology
9.What is E-leaning? Explain its advantages and disadvantages .2+3 Ans:- E-learning system based on formalised teaching but with the help of electronic resources is known as E-learning. While teaching can be based in or out of the classrooms, the use of computers and the Internet forms the major component of E-learning. E-learning can also be termed as a network enabled transfer of skills and knowledge, and the delivery of education is made to a large number of recipients at the same or different times. Earlier, it was not accepted wholeheartedly as it was assumed that this system lacked the human element required in learning. Advantages:- 1.Fast learning 2.Physical presence is not needed. 3.We may study in a group. 4.We can use Forum for questions and answers. Disadvantages:- 1.Unstable Internet may cause interrupt while study. 2.Students may not response. 3.Not so interactive etc 10.What is transmission medium? Differentiate between wired and wireless communication media.1+4 Ans:- Transmission medium:- It is a path through which data is transmitted.this path contains wires or soemtimes thin glasses. Difference between guided and unguided are given below.
11.What is OOP? Explain Object and class.1+4 Ans:- OOP:- The major motivating factor in the invention of object oriented is to remove some of the flaws encountered in the procedural oriented approach. Object oriented programming uses concept of “Object” and treats data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the functions that operate on it, and protects it from accidental modifications from outside functions. Some features are:- 1) Emphasis is on data rather than procedures or algorithms. 2) Programs are divided into what are known as objects. 3) Data structures are designed such that characterize the objects. Second part:- 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.for example in java, simply we can create by writing , class name { members; functions; } here, we can see a class named helloworld.It displays output hello world! by creating a class we create an object/s. 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). For example if “customer” and “account.” are two objects in a program, then the customer object may send a message to the account object requesting for the bank balance. Each object contains data and code to manipulate the data. Objects can interact without having to know details of each other’s data or code. 12.What is multimedia? Explain 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. 13.What is DMBS? Explain the advantages of normalization.2+3 Ans:- DMBS:- 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. 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. It is of following types: 1N 2N 3N 4N and 5N Advantages:- Some of the major benefits include the following :
a) Data Security b) Cyber Law c) System Testing Ans:- a) Data Security Ans:-
:- This law is commonly known as the law of the internet. It governs the legal issues of computers, Internet, data, software, computer networks and so on. These terms of legal issues are collectively known as cyberspace. In other words, it is a type of law which rules on the Internet to prevent Internet related crime. Cyber law is a new and quickly developing area of the law that pertains to persons and companies participating in e-commerce development, online business formation, electronic copyright, web image trademarks, software and data licenses, online financial transactions, interactive media, domain name disputes, computer software and hardware, web privacy, software development and cybercrime which includes, credit card fraud, hacking, software piracy, electronic stalking and other computer related offenses. c) System Testing :- Before actually implementing the new system into operations, a test run of the system is done removing all the bugs, if any. It is an important phase of a successful system. After codifying the whole programs of the system, a test plan should be developed and run on a given set of test data. The output of the test run should match the expected results. Using the test data following test run are carried out:
Unit test: When the programs have been coded and compiled and brought to working conditions, they must be individually tested with the prepared test data. Any undesirable happening must be noted and debugged (error corrections). System Test: After carrying out the unit test for each of the programs of the system and when errors are removed, then system test is done. At this stage the test is done on actual data. The complete system is executed on the actual data. At each stage of the execution, the results or output of the system is analysed. During the result analysis, it may be found that the outputs are not matching the expected out of the system. In such case, the errors in the particular programs are identified and are fixed and further tested for the expected output. When it is ensured that the system is running error-free, the users are called with their own actual data so that the system could be shown running as per their requirements. | |||||||||||||||||||||||||||
THE END |
|
Shooting Casino Slots Online
ReplyDeleteShooting Casino Slots 메리트 카지노 가입 Online luckyclub ✓ Play 7700+ FREE 카지노 사이트 제작 Online Slots 제왕 카지노 보증 ✓ Great Jackpots ✓ Top Rated Casino Software Providers ✓ Free Spins ✓ Best Bonus 바카라 규칙 Offers.