HISSAN-GRADE XII- 2069(2013) Computer Science [230-M1] |
|||||||||||
|
|||||||||||
Time: 3 hrs Full Marks : 75
Pass
Marks: 27 |
|
||||||||||
Group
“A” Long
Answer questions
4x10=40 |
|||||||||||
Attempts any Four questions: 1. a) Define the terms variable and constant.5 Ans:- Variable:- A variable is a value that can change any time. It is a memory location used to store a data value. A variable name should be carefully chosen by the programmer so that its use is reflected in a useful way in the entire program. Any variable declared in a program should confirm to the following: They must always begin with a letter, although some systems permit underscore as the first character. ->White space is not allowed. ->A variable name should not be a keyword. ->It should not contain any special characters. Examples of invalid variable names are 123 (area) 6th % abc Examples of valid variable names are Sun number Salary Emp_name averagel Constant:- A constant value is the one which does not change during the execution of a program. C supports several types of constants. These constants are given below:
Integer Constant:- An integer constant is a sequence of digits. There are 3 types of integers namely decimal integers, octal integers and hexadecimal integers. These constants are given below. Decimal Integers: 123 -31 0 +78 Octal Integers: O26 O O347 O676 b) What is algorithm? Explain with example.5 Ans:- Algorithm:- This is the first step or a tool which we apply while designing the system. It says about sequence of finite steps written in certain order manually by programmers to carry out job. While writing algorithm, we follow or use general English words which we use in our daily life. There is no particular rule for that. Mostly, it uses 4 units namely inputs, processes, storing and output. Let’s see an example to be clear. General features of Algorithm: · Clear specification of input · Uses variables · Provides clear steps, processes, controls and specifications. · Uses subroutines. Rules for algorithms: 1. Finiteness 2. Input if needed with processes should be shown 3. Very simple language should be used 4. The writer while writing algorithm should be keep in mind about program to be written after this.
An algorithm to get sum of two numbers: Step 1: start Step 2: get two numbers say a,b Step 3: let sum=a+b Step: 4 print sum Step 5 stop 2.a) What is function? Differentiate between library and user defined function.1+4 Ans:- Function:- Definition: A self –contained block of code that performs a particular task is called Function. Features of function: 1.fast development 2.can be developed in team 3.More flxibility 4.Fast fault finding 5.Top-down approach to solve the problem 1. Function Declaration (Function Prototype) 2. Function Call 3. Function Definition 4.Returning some value For example, int sum(int,int); int main() { sum(2,3); return 0; } int sum(int a,int b) { return a+b; } Here, int sum(int,int); is called prototype.It contains two parameters. sum(2,3) is called calling of function. In sum(2,3), 2 and 3 are called real arguments. int sum(int a,int b) { return a+b; } is called body part of function. Second part:- Library function: 1.This is a function existing inside the library. 2.It can only be used. 3.Further modification is not allowed. 4.We need header file for this. e.g. sqrt() or printf() User defined function:-1.This is a function created by user. 2.It can be used or created. 3.We can modify ourselves. 4.Header file is not needed. e.g. void sum() b) WAP to enter any number N and find the sum of the numbers upto N using loop.5 Ans:- //program to get sum of 'n' integers using function. #include<stdio.h> #include<conio.h> void sum(); void main() { sum(); getch(); } void sum() {int k=1,N,sum=0; printf("enter value of 'n'\n"); scanf("%d",&N); while(k<=N) { sum=sum+k; k++; } printf("sum=%d",sum); } 3.What is an array? Write a C program to enter age of 50 person and display the age greater than 40.2+8 Ans:- Array:- Definition: A composite variable capable of holding multiple data of same data type under a single variable name is called array. Features: ->stores multiple values ->helps to solve complex porblem ->can be used as array as pointer ->pixel based graphics programming made easier etc Declaration of Array: datatype array_name [size]; Example: - int marks [10]; int x[4]={1,2,3,4}; Array size is fixed at the time of array declaration. Generally, we use for loop () to assign data or item in memory and also use this loop to extract data from memory location. Types of Array: There are 2 types of array. a) One Dimensional Array (1-D): IT is an array where we use one subscript value.It stores value in row in contigous cells. syntax: data type arra[value/size]; For example: int a[10]; This array stores ten value starting from location zero na dends at 9. b) Two Dimensional Array (2-D):an array where we may use two or more than two subscript values. In this we use matrix concept. syntax: data type arra[row size][column size]; For example: int a[2][2]; It uses two rows and two columns. Values are stored as:
This array stores total four values starting from location zero and ends at 1. Second part:- /*Write a C program to enter age of 50 person and display
the age greater than 40. */ #include <stdio.h> int main() { float age[50]; int i; printf("enter
age of 50 persons\n");
for(i=0;i<=49;i++) {
scanf("%f",&age[i]); }
printf("Persons having age above 40 are:");
for(i=0;i<=49;i++) {
if(age[i]>40)
printf("%f,",age[i]); } return 0; } Ans:- //program to get factorial value of a number using recursion #include <stdio.h> #include <stdlib.h> int recur(int n); int main() { int n; printf("ente a number\n"); scanf("%d",&n); printf("the factorial value is\n"); printf("%d",recur(n)); getch(); return 0; } int recur(int n) { if(n<=0) { return 1; } else { return n*recur(n-1); } } 5.Write a C program that takes input(s_id,s_name,s_add and s_salary) of 20 staffs from user and stores record of 20 staffs in a data file named staffs.txt. The program should also display the records in appropriate format reading from the file. Ans:- /* program that takes input(s_id,s_name,s_add and s_salary) of 20 staffs from user and stores record of 20 staffs in a data file named staffs.txt. The program should also display the records in appropriate format reading from the file. .*/ #include<stdio.h> int main() { FILE *fp; int s_id; char s_name[30],s_add[100]; float s_salary; fp=fopen("staffs.txt","w"); printf("Enter s_id,s_name, s_add and s_salary"); printf("press ctrl+z to exit\n"); while(scanf("%d%s%s%f",&s_id,s_name,s_add,&s_salary)!=EOF) { fprintf(fp,"%d%s%s%f",s_id,s_name,s_add,s_salary); } fclose(fp); fp=fopen("staffs.txt","r"); while(fscanf(fp," "%d%s%s%f",&s_id,s_name,s_add,&s_salary)!=EOF) { printf("id=%d,name=%s ,address=%s and salary=%f\n",s_id,s_name,s_add,s_salary); } fclose(fp); return 0; } | |||||||||||
10 |
|||||||||||
Group
“B”
Short Answer questions
7x5=35 |
|||||||||||
Attempts any
Seven questions: 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/functions:- 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.
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. Applications:- 1)Multimedia in Education: Multimedia is becoming popular in the field of education. It is commonly used to prepare study material for the students and also provide them proper understanding of different subjects.Nowadays Edutainment, a combination of Education and Entertainment has become very popular. This system provides learning as well as provides entertainment to the user. 2)Multimedia in Entertainment: Computer graphics techniques are now commonly use in making movies and games. this increase the growth of multimedia. 3)Movies: Multimedia used in movies gives a special audio and video effect. Today multimedia has totally changed the art of making movies in the world. Difficult effect, action are only possible through multimedia. 4)Games: Multimedia used in games by using computer graphics, animation, videos have changed the gaming experience. Presently, games provides fast action, 3-D effects and high quality sound effects which is only possible through multimedia. 5)Multimedia in Business: Today multimedia is used in every aspect of business. These are some of the applications:
Ans:- Normlization:- 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 : Some of the major benefits include the following :
Ans:- 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
Ans:- Computer network:- 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:-
Second part:- LAN:-
WAN:-
11.What is internet? Write the advantages of internet.1+4 Ans:- Internet:- 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. Advantages:- File sharing/transferring:- As the name suggests, Object-Oriented Programming or OOPs refers to languages that uses objects in programming. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. It differs from procedure Oriented Programming in following aspects. Second part:- Inheritance:- Inheritance is mainly used for code reusability.In the real world there are many objects that can be specialized. In OOP, a parent class can inherit its behavior and state to children classes. Inheritance means using the Predefined Code. This is very main feature of OOP, with the advantage of Inheritance we can use any code that is previously created. This concept was developed to manage generalization and specialization in OOP. Lets say we have a class called Car and Racing Car . Then the attributes like engine no. , color of the Class car can be inherited by the class Racing Car . The class Car will be Parent class , and the class Racing Car will be the derived class or child class The following OO terms are commonly used names given to parent and child classes in OOP: Superclass: Parent class. Subclass: Child class. Base class: Parent class. Derived class: Child class It can have many types. single inheritance:-one derived class inherits property from one base class multiple “ :- one derived class inherits property from many base classes. multi level “ :-in this many derived classes are inherited from many base classes hierarchical “ :-under this many derived classes can be inherited from single base class hybrid “:-it’s a combination of hierarchical and multilevel. 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. 13.What do you understand by Artificial Intelligence (AI)? What are the application areas of AI?2+3 Artificial Intelligence:- Artificial intelligence is where machines can learn and make decisions similarly to humans. There are many types of artificial intelligence including machine learning, where instead of being programmed what to think, machines can observe, analyse and learn from data and mistakes just like our human brains can. This technology is influencing consumer products and has led to significant breakthroughs in healthcare and physics as well as altered industries as diverse as manufacturing, finance and retail. Uses:-We can use AI in following fields. 14.Write short notes on any two: a) E-commerce :- E-commerce is a transaction of buying or selling online. Electronic commerce draws on technologies such as mobile commerce, electronic funds transfer, supply chain management, Internet marketing, online transaction processing, electronic data interchange (EDI), inventory management systems, and automated data collection systems. Modern electronic commerce typically uses the World Wide Web for at least one part of the transaction's life cycle although it may also use other technologies such as e-mail. e-commerce in business:- E-commerce businesses may employ some or all of the following:
b) E-governance :- Electronic governance or e-governance is the application of information and communication technology (ICT) for delivering government services, exchange of information, communication transactions, integration of various stand-alone systems and services between government-to-customer (G2C), government-to-business (G2B), government-to-government (G2G) as well as back office processes and interactions within the entire government framework. Importance of e-governance:- Because of following points we have to use e-governance.
c) Fiber Optics cable:- An optical fiber or optical fiber
| |||||||||||
2.5+2.5 |
SET -3
No comments:
Post a Comment