xii tamil nadu state board computer notes - vol ii

55
1 COMPUTER SCIENCE SECOND YEAR (STD XII) Volume 2 Notes (2 marks,5 marks and one word questions and answers)

Upload: ram-iyer

Post on 31-Oct-2014

2.691 views

Category:

Documents


2 download

DESCRIPTION

Contains notes on Computer Science XII Std TN Board - Volume II - by Prabha RamanathanIncludes 5 marks/3marks/1 word notes

TRANSCRIPT

Page 1: XII Tamil Nadu State Board Computer Notes - Vol II

1

COMPUTER SCIENCE

SECOND YEAR (STD XII)

Volume 2 Notes

(2 marks,5 marks and one word questions and answers)

Page 2: XII Tamil Nadu State Board Computer Notes - Vol II

INDEXCHAPTER 1: OBJECT ORIENTED CONCEPTS USING C++..................................................................................3

IMPORTANT TWO MARKS QUESTIONS...............................................................................................................3ONE WORD QUESTIONS.........................................................................................................................................3

CHAPTER 2: OVERVIEW OF C++...............................................................................................................................5IMPORTANT TWO MARKS QUESTIONS...............................................................................................................5ONE WORD QUESTIONS.......................................................................................................................................10

CHAPTER 3: BASIC STATEMENTS..........................................................................................................................12IMPORTANT TWO MARKS QUESTIONS.............................................................................................................12IMPORTANT FIVE MARKS QUESTIONS..............................................................................................................12ONE WORD QUESTIONS.......................................................................................................................................15

CHAPTER 4: FUNCTIONS...........................................................................................................................................16IMPORTANT TWO MARKS QUESTIONS.............................................................................................................16IMPORTANT FIVE MARKS QUESTIONS..............................................................................................................16ONE WORD QUESTIONS.......................................................................................................................................20

CHAPTER 5: STRUCTURED DATA TYPES: ARRAYS...........................................................................................21IMPORTANT TWO MARKS QUESTIONS.............................................................................................................21ONE WORD QUESTIONS.......................................................................................................................................23

CHAPTER 6: CLASSSES AND OBJECTS................................................................................................................24IMPORTANT TWO MARKS QUESTIONS.............................................................................................................24ONE WORD QUESTIONS.......................................................................................................................................25

CH 7 POLYMORPHISM................................................................................................................................................27IMPORTANT TWO MARKS QUESTIONS.............................................................................................................27IMPORTANT 5 MARKS QUESTIONS....................................................................................................................27ONE WORD QUESTIONS.......................................................................................................................................29

CHAPTER 8: CONSTRUCTORS AND DESTRUCTORS........................................................................................30IMPORTANT TWO MARKS QUESTIONS.............................................................................................................30ONE WORD QUESTIONS.......................................................................................................................................30

CHAPTER 9: INHERITANCE.......................................................................................................................................31IMPORTANT 2 MARKS QUESTIONS....................................................................................................................31IMPORTANT 5 MARKS QUESTIONS....................................................................................................................32ONE WORD QUESTIONS.......................................................................................................................................33

CHAPTER 10: IMPACT OF COMPUTERS................................................................................................................35IMPORTANT 2 MARKS QUESTIONS....................................................................................................................35ONE WORD QUESTIONS.......................................................................................................................................35

Chapter 11: IT ENABLED SERVICES (ITES)............................................................................................................36IMPORTANT 2 MARKS QUESTIONS....................................................................................................................36ONE WORD QUESTIONS.......................................................................................................................................37

Chapter 12: COMPUTER ETHICS..............................................................................................................................38IMPORTANT TWO MARKS QUESTIONS.............................................................................................................38ONE WORD QUESTIONS.......................................................................................................................................38

2

Page 3: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 1: OBJECT ORIENTED CONCEPTS USING C++

IMPORTANT TWO MARKS QUESTIONS Define object

An object is a group of related functions and data that serves those functions An object is a kind of a self-sufficient “subprogram” with a specific functional area. The set of data items is split into smaller groups such that a set of operations can be performed on this group

without calling any other function. This group of data and the operations together are termed - ‘object’.

What is the significance of an object?Real life objects like a bank-account, a student, a bird, a car , a chair etc., embodies both state and behaviour and hence there is a resemblance with Objects in programming. Hence, Objects make it easy to represent real systems in software programsAn object is a group of related functions and data that serves those functions.

Define encapsulationThe mechanism by which the data and functions are bound together within an object definition is called as ENCAPSULATION.

Define polymorphismThe ability of an object to respond differently to different messages is called as polymorphism.Polymorphism reduces software complexity, as multiple definitions are permitted to an operator or functionExample: Consider the job of drawing different shapes like rectangle, square, circle and an arc. If we use one function, say, draw() which accepts different inputs and performs different functions accordingly for drawing different shapes, then as far as the user is concerned, he will use the function draw() to draw different objects with different inputs. This differential response of the function draw() based on different inputs is what is called as polymorphism.

List advantages of object oriented programmingAdvantages of Object Oriented Programming – Class data type allows programs to organize as objects that contain both data and functions . Data hiding or Abstraction of data provides security to data, as unrelated member functions(functions defined

outside the class cannot access its data Polymorphism reduces software complexity, as multiple definitions are permitted to an operator or function Inheritance allows a class to be derived from an existing class , thus promoting reusability of code, and also

promote insertion of updated modules to meet the requirements of the dynamic world What is meant by inheritance

Inheritance allows a class to be derived from an existing class, thus promoting reusability of code, and also promote insertion of updated modules to meet the requirements of the dynamic world

ONE WORD QUESTIONS __operates on a set of known input data items. Computer programinput and output data items were represented as __ variables___categorize the input data items. Data types__help us in organizing our ideas about the solution of the problem. Programming languagesSolution of a problem was earlier viewed as two separate segments: data and operationsObject oriented programming languages such as ___are based on the way human beings normally deal with the complex aspects

C++

facilitates the way of problem solving by combining ‘data’ and ‘operations’ that are to be performed on the data

Object Oriented programming

Group of data and operations together are termed as objects___refers to physical features of an object State___refers to kind of functions that an object can perform. Behaviour__is a group of related functions and data that serves those functions. Object_is a kind of a self sufficient subprogram with a specific functional area. Object___communicates with one another sending data as inputs object___ (or abstraction of data) provides security to data data hidingThe process of grouping data and its related functions into units called as objects is _ encapsulationMechanism by which data and functions are bound together is called __ encapsulationAbility of an object to respond differently to different messages is called polymorphism.Different response to different inputs is called polymorphism.___reduces software complexity polymorphism___provides multiple definitions to an operator or function PolymorphismThe data type __conventionally represents an object in the real world Class__is a template for entities that have common behaviour. Class___allows programs to organize as objects that contain both data and functions Class data type

3

Page 4: XII Tamil Nadu State Board Computer Notes - Vol II

__are power packed as they include the functionality of the base class along with their own unique features

derived classes

process of acquiring base class is called ___ inheritance___increases the functionality of a derived class. Inheritance___promotes reusability of code of the base class Inheritance___ promote insertion of updated modules to meet requirements of dynamic world inheritance

4

Page 5: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 2: OVERVIEW OF C++

IMPORTANT TWO MARKS QUESTIONS

What are tokens? Write the classification of tokensThe basic types of elements used for coding are collectively called as TOKENS. A token is the smallest individual unit in a program. Tokens are classified as shown

What are keywords? Give examplesKeywords have special meaning to the language compiler. These are reserved words for special purpose. These words cannot be used as normal identifiers. Examples: Auto, break const, case class, continue, default, delete, do, else, enum, for, friend, goto, if inline, new, operator, private, protected, public, return, signed, sizeof, static, struct, switch, this, unsigned, virtual, while.

Write a short note on identifiers in C++Identifiers are also called as variables. Variables are memory boxes that hold values or constants. A variable name must begin with an alphabet or underscore followed by alphabets or numbers. For example _test ; test ; sum12 are some valid identifiers.

Write a note on string literalString Literal is a sequence of characters surrounded by double quotes. String literals are treated as array of characters. Each string literal is by default added with a special character ‘\0’ which marks the end of a string. For example “testing”

Define operators. What are their classifications?Operator specifies an operation to be performed that yields a value. An operand is an entity on which an operator acts.For example: RESULT = NUM1 + NUM2NUM1 and NUM2 are operands. + is the additional operator, that performs the addition of the numbers. The result (value) generated is stored in the variable RESULT by virtue of “=” (Assignment) operator.Operators are classified as Arithmetic Assignment Conditional Logical Manipulator Shift Preprocessor Relational Scope Resolution Type Cast Member dereferencingMemory Management Component Selection

Which operators are specific to C++?

The operators specific to C++ are

What are relational operators? List out the relational operators in C++Relational Operators are used to compare values. The list of relational operators are :a)= = equal to b) > greater than c)< lesser than d)>=, <= greater than or equal to , lesser that or equal to e) != not equal toA relational expression is constructed using any two operands connected by a relational operator.The result of a relational operation is returned as true or false. The numeric constant zero (0) represents False value, and any nonzero constant represents true value.Example: a) 10 > 20 (is false, will return 0 ) b) 9==9 (is true, will return 1)

Explain conditional operators with example?: Is a ternary operator or is also called as the conditional operatorThe general syntax is E1 ? E2 : E3 where E1,E2,E3 are operands. E1 should essentially be of scalar type, E2 and E3 are values or statements.For example to find the maximum value of the two values one can express it as :max = (num1 > num2) ? num1 : num2; The variable max will take the value of num1 if num1 is greater than num2, otherwise max will be assigned with the value of num2.

Write code using conditional operators for F=0.5 if x=30 otherwise f=5F = (x == 30) ? 0.5: 5;

Write a note on assignment operators= is the simple assignment operator. It is used to assign the result of an expression (on the right hand side) to the variable (on the left hand side of the operator). In addition to the simple assignment operator, there are 10 ‘shorthand’ or compound assignment operators.They are: += , -=, *= , /= , %= (Bitwise assignment operators)&=, |=, ^=, <<= , >>=

5

Page 6: XII Tamil Nadu State Board Computer Notes - Vol II

List any four punctuators in C++ and write a line about themPunctuators are characters with a specific function. Punctuators Purpose

; Terminates a C++ statement// Treats statements prefixed with this as comments

/* */ Blocks enclosed within these character are treated as comment{ } Used to group a set of c++ statements. Coding for a function is also enclosed within these symbols[ ] Index value for an element in an array is indicated within these brackets‘ ‘ Is used to enclose a single character“ “ Is used to enclose a set of characters

What is a datatype in c++. What are the different datatypes in C++Data Types are the kind of data that variables hold in a programming language. The ability to divide data into different types in C++ enables one to work with complex objects. Data is grouped into different categories for the following two reasons :The compiler may use the proper internal representation for each data type2) The programmer designing the programs may use appropriate operators for each data type. They can be broadly classified into the following three categories: a) User defined type b) Built-in type c) Derived type

What is a user defined data type? List out user defined data typesUser Defined Data Type enables a programmer to invent his/ her own data type and define values it can assume. This helps in improving readability of the program.The various user defined data types are: Structure, Union, Class and EnumerationExample: student is a user defined data type of class

What is meant by type definition? Or write about typedef in C++Users can define a variable that would represent an existing data type. “Type definition” allows users to define such user defined data type identifier. The syntax : typedef data_type user_defined_data_type_identifier;For example: typedef int marks;The data type identifiers marks is user defined identifiers for int. Users can define variables of int as follows:

marks eng_marks, math_marks;grade eng_grade, math_grade ;

typedef helps in creating meaningful data type identifiers, that would increase the readability of the program.

Write a note on enumerated data type

6

Page 7: XII Tamil Nadu State Board Computer Notes - Vol II

Enumerated data type is one of the user defined data type. Enumerated data type helps users in creating a list of identifiers, also called as symbolic numeric constants of the type int.The syntax: enum data type identifier (value 1, value 2, … value n);Examples : enum working_days (Monday, Tuesday, Wednesday, Thursday, Friday);

enum holidays (Sunday, Saturday);The identifiers working_days , holidays are user defined data type. Monday, Tuesday … is the list of values also called as enumeration constants or numeric constants.Users can declare variables of this enumerated data type using the syntax :

enum identifier variable1, variable2 …,variable n;For example variables ‘first_workingday’ and ‘last_workingday’ of type ‘working_days’ may be declared as follows:

working_days first_workingday, last_workingday;These variables can take only one of the values defined for working_days.The enumeration constants (Monday, Tuesday, Wednesday…) are given integer constants starting with 0 (zero) by the compiler.first_workingday = Monday ; or first_workingday = 0 ;Users can also redefine these integer constants by assigning explicit values to the enumeration constants asenum working_days (Monday = 1, Tuesday, Wednesday, Thursday, Friday);Here, constant Monday is assigned value of 1. The remaining constants are assigned successive integer constants.

What is the void data type? List important purposes of void data typevoid data type indicates the compiler that the function does not return a value, or in a larger context void indicates that it holds nothing.Void type has two important purposes:

o To indicate the a function does not return a valueo To declare a generic pointer

In the example, the prototype void fun(void) indicates that the function does not return any value, nor does it receives values(in the form of parameters). Hence the call statement in the main() function is given as ‘fun()’ .

What are modifiers? What is the impact of modifiers? Basic data types (like integral and floating) have several modifiers. These modifiers have a profound effect in the internal representation of data. The modifier alters the base data type to yield new data type.long, short, signed and unsigned are modifiers(qualifiers) that modify built–in data type with the exception of void.The impact of modifiers:

o unsigned modifies the range of the integer values as the sign bit is also used to store data.o long increases the bytes for a particular data type, thus increasing the range of values.

Example : unsigned int registration_number;long unsigned int index;short signed char c;

Prefix the data type with modifiers at the time of declaring variables.

Name the four storage specifiers The four storage specifiers are auto, static, extern and register. static and register variables are automatically intialized to zero when they are declared. Auto variables are not initialized. Auto variables get undefined values known as garbage.

Write a note on storage classes in C++Storage Class is another qualifier (like long or unsigned) that can be added to a variable declarationStorage Meaning ExampleAuto Defines local variable known to the block in which they are defined.

By default the local variables are auto hence rarely usedvoid main(){ auto float ratio; Int kount;}The variables ratio and kount have storage specifiers as auto

static Variables defined within a function or a block do not exist , the moment the function or the block loses its scope. Static modifier allows the variable to exist in the memory, even if its function or block within which it is declared loses its scope. Hence static variable retains the last assigned value.

void fun(){static int x;x++;}

7

Page 8: XII Tamil Nadu State Board Computer Notes - Vol II

extern Global variable known to all functions in the current program. These variables are defined in another program.

extern int filemode;extern void factorial();

register The modifier register instructs the compiler to store the variable in the CPU register to optimize access.

void fun(){register int i;}

What is a pointer variable? Give example or How to declare pointer variable?A pointer is a variable that holds a memory address. Pointers provide the means through which the memory locations of a variable can be directly accessed. Every byte in the computer’s memory has an address. The address number starts at NULL and goes up from there.. 1, 2 , 3…..For example a memory size of 640 KB will have addresses commencing from NULL and goes up to 655, 358

Here, iptr is a pointer variable. The declaration statement int *ptr may be read as ptr is a pointer variable of the type int. The variable ptr can only store addresses that hold integer values. Examples of pointer variables:char *cptr declaring a pointer to character type float *fptr pointer to float typevoid *vptr a pointer that can point to any data type a generic pointer is declared in this wayconst int * ptr ptr is a pointer to a constant integer (cannot modify the value stored at the address pointed by ptr)char * const cp cp is a constant pointer. The address stored in cp cannot be modified

How is a pointer variable different from ordinary variable?1) Variables are allocated memory to store data. Compiler allocates memory, based on the data type of the

variable. Pointer variables store the address of other variables.2) A variable gets defined when memory is set aside .Some variables also get defined when they are declared

but Pointer variables get defined only when memory is fetched. For example by using new memory operator

What are the rules for implicit conversion?Implicit conversions: refers to data type changes brought about in expressions by the compiler.Consider a term, having a pair of operands and an operator. The conversions takes place as follows :1. If one operand is of type long double , then the other value is also converted to long double.2. If one operand is of type double, then the other value is also converted to double.3. If one of the operands is a float, the other is converted to a float.4. If one of the operands is an unsigned long int, the other is converted to unsigned long int.5. If one of the operands is a long int, then the other is converted to long int.6. If one operands is an unsigned int, then other is converted to an unsigned int.

Write a note on sizeof operatorsizeof is an operator . It returns the size (memory requirement) in terms of bytes, of the given expression or data type. For example, size of int is 2, size of float is 4, size of double is 4 etc.

Explain & operator and the * operator with respect to the pointers?When dealing with pointer data type one needs to know about the address of (&) operator and the value at operator (*).& operator

int i = 10; cout<<&i;

will display the address of the variable i and not the value 10

int *iptr, num1; num1 = 10; iptr = &num1;

Here, the iptr is a pointer variable and the address of the variable num1 is assigned to the pointer variable iptr

* operator The asterix ( * ) is1) Used to declare a pointer variable2) Used to display the contents stored at a location ( value at the address operator )3) It is a unary operator

Write a note on type castType cast refers to the process of changing the data type of the value stored in a variable . The statement (float) 7 , converts the numeric constant 7 to float type. Type cast is achieved by prefixing the variable or value with the required data type. The syntax is: (data type) <variable/value> or data type (variable/constant)Type cast is restricted only to fundamental or standard data types.

8

Page 9: XII Tamil Nadu State Board Computer Notes - Vol II

Evaluate the expressionsIf c = 5, d=6, choice=’y’ and term=2 then evaluate the expression

Result = (c==d) && (choice != term)

Result = 0 (false)

PROBLEMS Evaluate: assume a=5, b=3, d=1.5 C is integer and F is float

1) F = a + b/a :5 + 3/5 = 5+ 0 = 5.0000002) C = d * a + b : 1.5 * 5 + 3 = 7.5 + 3 = 10.5 = 10 { because C is an integer}

Find the output of the foll: x=5; F=6; C = X++ + ++F;C = 5++ + ++6 = 5 + 7 = 12 . C=12, x=6 and F=7

Operator Precedance

Data Types sizes and range of valuesType Byte Rangechar 1 -128 to 127unsigned char 1 0 to 255signed char 1 -128 to 127int 2 -32768 to 32767unsigned int,unsigned short int 2 0 to 65535signed int,short int, signed short int 2 -32768 to 32767long int,signed long int 4 -2147483648 to2147483647unsigned long int 4 0 to 4294967295float 4 3.4e-38 to 3.4e+38double 8 1.7e-308 to1.7e+308long double 10 3.4e-4932 to 1.1e+4932

9

Page 10: XII Tamil Nadu State Board Computer Notes - Vol II

ONE WORD QUESTIONS

C++ was developed by AT&T BELL LaboratoriesC++ was developed by __in___ Bjarne Stroutstrup, 1980C++ was coined by ___ Rick Mascitti

___are the basic elements essential for programming coding Basic types are collectively called as ___ __ is the smallest unit of a program

Tokens

___have special meaning to the language compiler __are reserved words for special purpose

Keywords

___are also called as variables Identifiers____ are memory boxes that hold values or constants Identifiers___are data items whose values cannot be changed Constants Octal constant starts with __ 0 (ZERO) hexadecimal constant starts with __ 0x___constant is a signed real number floating point_is a constant that contains a single character enclosed within single quotes Character constant__are non graphic character constants and are prefixed with a backslash (\) Escape sequencesEscape Sequenceshorizontal tab \t Vertical tab \v bell \a Newline/linefeed \n Backslash \\

Single quotes \’ Null \0 Octal \o Double quotes \” Hexadecimal \x

___is a sequence of characters surrounded by double quotes ___are treated as array of characters

String literal

___marks the end of string ‘\0’___specifies operations to be performed that yields a value Operator___is an entity on which operator acts Operand there are 3 types of operators SPECIFIC to C++ :: .* ->*Based on operand requirements, operators are classified as ___operators unary, binary and ternaryUnary operators require ___operandBinary operator requires ___ operandsTernary operator requires ___ operands.

OneTwoThree

__ is the scope resolution operator ::The operators ___are used only by the preprocessor # and ##__are used to perform mathematical operations Arithmetic operators logical grouping of operators and operands are called __ associativity __are used to compare values Relational operators ___combine the result of one or more conditions Logical operators___is a ternary operator Conditional operator (? :) = is an ___ assignment operator There are ___shorthand assignment operators 10___are characters with specific functions PunctuatorsPunctuators

terminates c++ statement ; single line comment // Multi line comment /* */group a set of c++ statements { } Index value for array element [ ] Enclose single character ‘ ‘Enclose set of characters “ “

___are kind of data that variable can hold Data types There are 3 categories of data types: User defined, Built-in & Derived ___data type improves readability of the program___enables programmers to invent their own data type and define values it can assume

User defined

___allow users to define user defined data type identifiersUsers can define a variable that would represent an existing data type, can be achieved by ___

“Type definition” (typedef)

___data type helps in creating list of identifiers___ data type is also called as symbolic numeric constants of the type int

Enumerated

There are 4 storage specifiers: auto, static, extern and register___variables are not initialized automatically and is default storage class___ variables get undefined values known as garbage

Auto

___ variables retain the last assigned value Static

10

Page 11: XII Tamil Nadu State Board Computer Notes - Vol II

Built in data types is the other name for ___They are predefined in the compiler.

fundamental or basic data type

There are 3 fundamental data types: Integral, float and void___type is further divided into int and char. Integral___ type is further divided into float and double floating ASCII value of ‘A’ is 65___does not have a return value___ is used to declare a generic pointer

Void

__is a variable that holds memory address of other variables pointer Every byte in the computer memory has an addressA memory size of ___ will have addressescommencing from NULL and goes up to 655, 358

640KB

Amount of memory allocated depends on the ___ data type __ is the ‘address of’ operator & __is the ‘value at’ operator * The pointer variable ___ is a unary operatorpointer variable __ is used to display the contents stored at a location

*

Names assigned to a data field that can assume any set of values are called ______are user defined named entities of memory locations that store data___are allocated memory to store data

variables

There are nine words for data types such as: char , int , double , float, void, short, signed, long and unsigned

long, short, signed and unsigned are ___that modify a built-in data type with the exception of void.The ___alters the base data type to yield new data type

qualifiers or modifiers

modifier variable names should be separated by __ comma Integer values are stored in ___format 16 bit bits are used to store data maximum value stored in an ___is +32767 and minimum value is -32768 integer ___ bit is the most significant bit 16thWhen the modifier ___is used integer data type will store only positive values, sign bit is also used to store data.

unsigned

_increases the bytes for a particular data type, thus increasing the range of values

long

__qualifier specifies value of a variable will not change at run time Const ___refers to the data type changes brought about by the compiler implicit conversions_returns the size or memory requirement in term of bytes Sizeof operator process of changing the data type of the value stored in a variable is __. typecast

11

Page 12: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 3: BASIC STATEMENTS

IMPORTANT TWO MARKS QUESTIONS

What are the various sections of a C++ programA C++ program has primarily three sections viz.,

Include files Declaration of variables, data type, and user defined functions. main() function

On successful compilation, when the program is executed the main() function will be automatically executed. It is from this block, that one needs to give call statements to the various modules that need to be executed and the other executable statements.

What do you know about assignment statements in C++An assignment statement, assigns value on the right hand side of an expression to the variable on the left hand side of the assignment operator. ‘=’ is the assignment operator. For example:

num = 5;total = english+maths;sum += class_marks;

During assignment operation, C++ compiler converts the data type on the right hand side of the expression to the data type of the variable on the left hand side of the expression.

What are control structures? What are the two main categories of control structures? OR Define control statements in C++Program statements that cause a jump of control from one part of a program to another are called Control Structures. The control structures are implemented in C++ using control statementsThe two major categories of control structures are Decision making statements or selection statements and Looping statements.The selection statements are: if-else and switch statementsThe looping statements are: do….while() loops, for loops and while() loops

Explain entry check and exit check loopsBased on the position of the condition, the loops are classified as Entry-Check loop and Exit Check Loop. If the condition is placed at the entry of the body of the loop, then it is called as Entry Check loop and if it is placed at the end of the body of the loop then it is called as exit check loopThere are three kinds of loops in C++, the for loop, the while loop and the do .. while loop. The for loop and the while loop are Entry check loop whereas the do…while loop is an exit check loop

List the rules for formation of nested loopsThe rules for the formation of nested loops are:1. An outer loop and inner loop cannot have the same control variable, as it will lead to logical errors2. The inner loop must be completely nested inside the body of the outer loop.

IMPORTANT FIVE MARKS QUESTIONS

Explain if else statement with exampleThe decision making or selection statements are: if-else and switch statementsif statement : is the simplest of all the decision statements. It is implemented in two forms: 1) Simple if statement2) if .. else … statement which chooses between two alternatives, executes the chosen block based on the condition Else block is executed only if True block is not executed.

12

Page 13: XII Tamil Nadu State Board Computer Notes - Vol II

Example:// Demonstrates use of if else statement# include <iostream.h># include <conio.h>void main(){int a;clrscr();cout << “\nEnter a number “;cin >> a;if ( a%2 == 0)cout <<“\nThe given number“ << a << “is even”;elsecout <<“\nThe given number“ << a << “is odd”;getch();}

In the above program “The given number 10 is even” is printed if the expression is evaluated to true, otherwise statement following else option will be executed.

Explain switch statement in detailSwitch statement is a decision making or selection statement. This is a multiple branching statement where, based on a condition, the control is transferred to one of the many possible points.

Example:# include <iostream.h># include <conio.h>void main() {int a, remainder;cout << “\nEnter a number ...”;cin >> a;remainder = a % 3;switch (remainder){case 1 : cout << “\nRemainder is one”; break;case 2 : cout << “\nRemainder is two”; break;default: cout << “\nThe given number is divisible by 3”; break;}getch();}

Above program checks for divisibility by 3 and prints messages accordinglyEvery action block should be terminated with a break statement. Otherwise all action blocks are executed sequentially from the point where the control has been transferred based on the condition.Switch selection expression must be of integral type which means that switch expression should be evaluated to an integer constant only

Explain nested if statement with example of c++Nested if statement : The statement sequence of if or else may contain another if statement ie., the if .. else statements can be nested within one another as shown below :

if (grade = = ‘A’)if (basic > 5500)incentive = basic * 10/100;elseincentive = basic * 5/100;elsecout << “Try to attain Grade A”;

In an nested if .. else statement, “Each else matches with the nearest unmatched preceding if”

Discuss about the general working of loopsLoops execute a set of instructions repeatedly for a certain number of times. A looping block consists of two segments viz., the body of the loop and the control statement.

13

Page 14: XII Tamil Nadu State Board Computer Notes - Vol II

The control statement checks the condition, based on which directs the control back to the body of the loop to execute the segment repeatedly. In general, a looping process would work in the following manner:

1. Initializes the condition variable2. Executes the segment of the body3. Increments the value of the condition variable as required4. Tests the condition variable in the form of a relational expression. Based on the value of the relational expression the control is either transferred to the beginning of the block, or it quits the loop.

There are three kinds of loops in C++, the for loop, the while loop and the do .. while loop.

Explain for loop with suitable examplefor (; ; ) .. loop : is an entry controlled loop and is used when an action is to be repeated for a predetermined number of times. The syntax is for(intial value ; test-condition ; increment)

{action block;

}The general working of for(;;)loop is:1. The control variable is initialized the first time when the control enters the loop for the first time2. Test condition is evaluated. The body of the loop is executed only if the condition is TRUE. Hence for(;;) loop is called as entry controlled loop.3. On repetition of the loop, the control variable is incremented and the test condition will be evaluated before the body of the loop is executed.4. The loop is terminated when the test condition evaluates to false.

# include <iostream.h># include <conio.h>void main(){int i,fact = 1;for(i = 1; i < 6; i++)fact *= i;cout << “\n Factorial of the number is ..” << fact;}Example:The program below calculate factorial of 6.

Write a note on break and continue statements Break statementA loop’s execution is terminated when the test condition evaluates to false. Under certain situations one desires to terminate the loop, irrespective of the test expression.Example: # include <iostream.h>

# include <conio.h>void main(){clrscr();int a[] = {1,2,3,4,5,6,7,8,9};int search_item = 7;for(int x=0; x<9;x++) { if (a[x] == search_item) { cout << “\nItem found at position ..” << x; break;}}cout << ‘\n’ << “value of index position is ..” << x;getch(); }

The result of the index position will be 6, and as soon as the match occurs, the break statement will terminate the loop. Hence, break statement accomplishes jump from the current loopContinue statementThe continue statement forces the next iteration of the loop to take place, skipping any code following the continue statement in the loop body. Example # include <iostream.h>

# include <conio.h>void main(){int i = 1,sum = 0;for(;i<10;i++) { if( i % 2 == 0){ sum += i; continue;}

14

Page 15: XII Tamil Nadu State Board Computer Notes - Vol II

cout <<i;}cout << “\nSum of even nos..”<<sum;getch();}

ONE WORD QUESTIONS There are __methods for assigning data to the variable. They are assignment statement and reading the data during runtime of the program

two

__is a predefined object that corresponds to a standard input stream cinThe declaration for the object cin are available in a header file called ___ istream.hThe declaration for the object cout are available in a header file called ___ ostream.h__combines the properties of istream and ostream.The declaration for the objects cin and cout are available in a header file called __

Iostream.h

A __comprises of all standard declarations and definitions for predefined functions. Header fileOne can include a header file using a __directive. preprocessorA preprocessor directive starts with __ #__is a typical preprocessor directive. #include__is the extraction operator or get from operator. >> (get from)__is called the insertion operator or put to operator << (put to)cascading of __facilitates sending of multiple output via a single statement Insertion operatorA c++ program has primarily __sections. Three (3)If a declaration sets aside memory for the variable it is called___. definitionPointer variable gets defined by using a new memory operator.Program statements that causes flow of control from one part to another part is called control structures.variables used in control structures are called __ control variablesThere are __ categories of control structures: Decision making & Looping statements Two (2)Decision making statements are If and switch__statement chooses between two alternatives if-else__ is the simplest of all decision and has 2 forms (simple if and if-else statement) If statement__creates branching for multiple alternatives sections of code.___ is a multiple branching statement

Switch

To exit from switch statement, in each action block one has to include __ statement break__execute a set of instructions repeatedly for certain number times. LoopsA looping block consists of __ segments: the body of the loop and control statement Two (2)there are __ kinds of loops in C++: for, while and do-while loops Three (3)Based on the position of the condition, the loops are classified as: Entry and exit checkLoops are unconditionally executed at least once, if the condition is Exit checkdo while is an __loop exit checkwhile loop and for loops are _____loop entry checkA for loop consists of __ segments (initialisation of control variable, test condition and increment)

Three (3)

Each segment of the for loop is separated by __ operator ;inner loop must be completely nested inside the body of the __ outer loop__forces the next iteration of the loop to take place skipping any code following continue. Continue statement__would exit the current loop only___ accomplishes jump from the current loop

break statement

Programs are written in ___ language high levelProgram in high level language is called source codesource code is converted into machine readable code called __ object fileCompiler creates__. object files__are translator programs that create machine-readable program from source code Compilers__checks for the grammar of the language (SYNTAX) Compilersobject file is linked with libraries to generate __ executable file

15

Page 16: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 4: FUNCTIONS

IMPORTANT TWO MARKS QUESTIONS

What are the advantages of functions?Functions are the building blocks of C++ programs. Functions are also the executable segments in a program.Functions are advantageous because

1) They can be shared by other programs by compiling it separately and loading them together.2) They reduce the size of the program3) They induce reusability of code

Give a general syntax and example for function prototype (2)Functions should be declared before they are used in a program. Declaration of a function is made through a function prototype.The general syntax of a function prototype <type > <function identifier > (<arguments>);For example:

void fun (char);int max (int, int);int max (int a, int b);

The prototype provides the following information to the compiler: Number and type of arguments and the type of return values

What is the main purpose of function prototypeThe main purpose of function prototype is to help the compiler to check the data requirement of the function. With function prototyping, a template is always used when declaring and defining a function. When a function is called, the compiler uses the template to ensure that proper arguments are passed, and the return value is treated correctly. Any violation in matching of the arguments or the return types will be treated as errors by compiler, and flagged at the time of compilation.

Why do you think the prototype int max (int, int) is valid??In a function declaration, the names of the arguments are dummy variables and therefore they are optional. The variables in the prototype act as place holders.The arguments’ names are required in function definition, as the arguments are referenced inside the function

Define parametersThe call statement communicates with the function through arguments or parameters. Parameters are the channels through which data flows from the call statement to the function and vice versa.

Define actual parameters and formal parametersActual parameters are parameters associated with the call statementFormal parameters are the parameters associated with function header

List the two types of parameter passing in function (2)In C++, functions that have arguments can be invoked by

1) Call by value2) Call by reference

Differentiate between call by value and call by reference (2)Call by value Call by reference

The called function creates new variables to store the value of the arguments passed to it. Also, the flow of data is always from the call statement to the function definition.

Formal and actual parameters in reference type point to the same storage area

Any change in the formal parameter is not reflected back to the actual parameter.

Any change made in the formal parameter is reflected back in the actual parameter

List the types of scope rules of variables in C++ (2)There are four types of scopes in C++. They are: 1. Local scope 2. Function scope 3. File scope 4. Class scope

IMPORTANT FIVE MARKS QUESTIONS

How is a function called? Give example (5)A function can be called or invoked from another function by using its name. The function name may include a set of actual parameters, enclosed in parentheses separated by commas. For example,

16

Page 17: XII Tamil Nadu State Board Computer Notes - Vol II

Explain call by value with example (5)In the call by value method, the called function creates new variables to store the value of the arguments passed to it. This method copies the values of actual parameters into the formal parameters, thus the function creates its own copy of arguments and then uses them.Example:

# include <iostream.h># include <conio.h>int add (int a, int b){ return a + b;}void main ( ){ int x1, x2, sum;cin >> x1 >> x2;sum = add (x, x2);cout << sum;}

When arguments are passed by value, the called function creates new variables of the same data type as the arguments passed to it. The values of these arguments are copied into the newly created variables. Hence, changes or modifications that are made to formal parameters are not reflected in the actual parameters

Explain call by reference with example (5)In the call by reference method, the called function arguments – formal parameters become alias to the actual parameters in the calling function. This means that when the function is working with its own arguments, it is actually working on the original dataExample:# include <iostream.h>#include <conio.h>void swap (int &n1, int &n2){int temp;temp = n1;n1 = n2;n2 = temp;cout<<‘\n’<< n1<<‘\t’<<n2<<‘\n’;

}void main ( ) {int m1 = 10, m2 = 20;clrscr();cout<<“\nValues before swap call” <<‘\t’<<m1<<‘\t’<< m2;swap(m1,m2);cout<<“\n Calling swap..”;cout<<“\n Back to main.Values are” << ‘\t’ << m1 << ‘\t’<< m2;getch ( );}

17

Page 18: XII Tamil Nadu State Board Computer Notes - Vol II

The modifications made to formal parameters are reflected in actual parameters, because formal and actual parameters in reference type point to the same storage area

What are the rules for actual parameters?Rules for actual parameters are:1. The actual parameters can be passed in the form of constants or variables or expressions to the formal parameters which are of value type.For example,For a function prototype : int add (int n1, int n2); - the call statements may be as follows :

x = add (5, 10);x = add (a1, a2); where a1 and a2 are variables

2. The actual parameters can be passed only as variables to formal parameters of reference type.For example,

int add (int &n1, int &n2);x = add (a1, b1) ; where a1 and b1 are variablesThe following call statements are invalid:

x = add ((a1 + b1), a1);x = add (5,101);

What are default arguments? Give exampleIn C++, one can assign default values to the formal parameters of a function prototype

# include <iostream.h># include <conio.h>float power (float n, int p = 1){float prd = 1;for (int i = 1; i<= p; i++)prd *= n;return prd;}void main ( ){clrscr ( );int x = 4, b = 2;cout << “\n Call statement is power(b, x)...”<< power (b, x);cout << “\n Call statement is power(b).. “<< power (b);getch ( );}

In the call statement power (b,x), initialization is n= b, p = xIn the second form power (b), the variable n is initialized, whereas p takes the value 1 (default argument), as no actual parameters is passed.

Explain inline function with example (5)Call statement to a function makes a compiler to jump to the functions and also to jump back to the instruction following the call statement. This forces the compiler to maintain overheads like STACKS that would save certain special instructions pertaining to function call, return and its arguments. This reduces the speed of program execution. Hence under certain situations specially, when the functions are small, the compiler replaces the function call statement by its definition ie., its code during program execution. This feature is called as inlining of a function technically called as inline function.An inline function looks like a normal function in the source file but inserts the functions code directly into the calling program.Inline functions execute faster but require more memory space.Example:

# include <iostream.h># include <conio.h>inline float convert_feet(int x) {return x * 12;}void main() {clrscr();int inches = 45;cout << convert_feet(inches);getch(); }

18

Page 19: XII Tamil Nadu State Board Computer Notes - Vol II

the call statement to the function (convert_feet(inches) will be replaced by the expression in the return statement (inches * 12) as shown below:

# include <iostream.h># include <conio.h>void main() {clrscr();int inches = 45;cout << inches * 12 ;getch();}

Define scope. Explain various types of scopes in C++ language. (5)Scope refers to the accessibility of a variable Local Scope

1) A local variable is defined within a block2) The scope of a local variable is the block in which it is defined.3) A local variable cannot be accessed from outside the block of its declaration.4) A block of code begins and ends with curly braces { }.5) Local variables exist only while the block of code in which they are declared is executing. A local

variable is created upon entry into its block and destroyed upon exitCode Snippet:if (a > b){ int temp;temp = a;a= b;b = temp;}cout << a << b << temp;

The scope of the variable temp is not available outside its block and hence the compiler will throw an error at ‘cout’

Function scopeThe scope of variables declared within a function is extended to the function block, and all sub-blocks therein.The life time of a function scope variable, is the life time of the function block. The scope of formal parameters is function scope.Code:

# include <iostream.h>void main ( ){ int flag = 1; a = 100;while (flag){int x = 200;if (a > x){ int j;-}else{ int h;-}}}

Here, the variable flag is accessible in the function main() and also in the while block and the if block, whereas x is accessible inside the while block only

File scopeA variable declared above all blocks and functions (precisely above main ( )) has the scope of a file. The scope of a file scope variable is the entire program. The life time of a file scope variable is the life time of a program.

// scope of a variable declared at file level# include <iostream.h># include <conio.h>int i = 10;void fun ( ) { cout << i; }void main ( ) { cout << i; while (i) { - }

}

19

Page 20: XII Tamil Nadu State Board Computer Notes - Vol II

Define scope operatorThe scope operator or scope resolution operator reveals the hidden scope of a variable. :: is called as scope resolution operator. It is used to refer variables declared at file level. This is helpful only under situations where the local and file scope variables have the same name.Code:# include <iostream.h># include <conio.h>int num = 15;void main(){clrscr();int num = 5;num = num + ::num;cout << num << ‘\t’ <<++::num;getch();

}The variable num is declared both at file scope level and function main() level

ONE WORD QUESTIONS__are the building blocks of a c++ programs__ are the executable segments in a program__reduce the size of the program and induce reusability of code.

Functions

the starting point of the execution of a program is __ main()declaration of a function is made through a ____helps the compiler to check the data

function prototype

Variables in the prototype act as__. place holdersa function can be called from another using its __ name__are channels through which data flows from the call statement to the function parameters__ parameters are parameters associated with call statement actual__ parameters are parameters associated with function header. Formalfunction creates its own copy of the __ argumentsIn a __any change in the formal parameter is not reflected back to the actual parameterIn __actual parameters can be passed in the form of constants or variables or expressions.

call by value

In a __any change in the formal parameter is reflected back in the actual parameterIn __actual parameters can be passed in the form of variables only

call by reference

actual parameters can be passéd only as variables to formal parameters of __type

Reference type

In c++ one can assign default values to the parameters of a function prototype using__.

default arguments

default value is given in the form of variable initializationCompiler maintains overheads like __ that would save certain special instructions pertaining to a function call, return and its arguments__ reduces the speed of program execution

stacks

__ inserts the function code directly into the calling program inline functions__execute faster but require more memory space inline function__refers to the accessibility of a variable. Scopethere are __ types of scopes in c++: local, function, file and class scopes Four (4)_is defined within a block__ cannot be accessed from outside the block__ is created upon entry and destroyed upon exit of a block

local variable

life time of a __ variable is the life time of the function block function scopevariables declared above all blocks above main has __scope filescope of __variable is the entire program file scopeScope operator :: reveals the __of a variable. hidden scope

20

Page 21: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 5: STRUCTURED DATA TYPES: ARRAYS

IMPORTANT TWO MARKS QUESTIONS

What is an array? Write in brief about types of arraysAn array is a collection of variables of the same type that are referenced by a common name Arrays are of two types:

1) One dimensional: comprises of finite homogenous elements. Example: int num_array [5];2) Multi dimensional: comprises of elements, each of which is itself a one-dimensional array

An array marks [3][4] is a table with 3 rows, and 4 columns. Ex: float marks[3][4];

Write a note on array of characters or stringsStrings are otherwise called as literals, which are treated as single dimensional array of characters.The declaration of strings is same as numeric array. For example,

i. char name [10];ii. char vowels [ ] = {‘a’, ‘e’, ‘i’, ‘o’, ‘u’};iii. char rainbow [ ] = VIBGYOR;

A character array (used as string) should be terminated with a ‘\0’ (NULL) character.

Write a note on gets() or write the syntax of gets()To treat spaces as part of string literal, then one has to use gets ( ) defined in stdio.h or getline ( ) - a member function of standard input stream.Syntax for gets ( ) is gets (char array identifier) or gets (char *)

write the syntax of getline()getline() is a member function of standard input streamSyntax for getline is cin.getline (char *, no.of characters, delimiter);

Write the syntax of 2D array declaration OR What is a 2D array? How can it be declared?A two-dimensional array is an array in which each element is itself an array. For instance, an array marks [3] [4] is a table with 3 rows, and 4 columns.A 2-D array is declared as:

Type array-id [Rows] [Columns];Example:

1. int a[3] [2]- declares 3 rows and 2 columns for the array a2. const i=5; float num [i] [3] - declares a 2-D table num with 5 rows and 3 columns3. short fine [‘A] [‘E’] - declares a 2-D table of 65 rows and 69 columns

Write a note on memory representation of 2D arrayA 2-D array is stored in sequential memory blocks. The elements are stored either1. row-wise manner (this method is called as row-major order)2. column-wise manner (this method is called as column-major order)

Write a note on write() in C++write( ) is a member function of standard output stream, i.e., ostream. All member functions of a class, should be accessed through an object / instance of class. The two parameters required for write () function are identifier string characters, and the no. of characters to be displayed.Example: cout.write (pincode, 7);

# include <iostream.h># include <conio.h>void main() {clrscr ( );char name[] = “Tendulkar”;int i=1;while (i<10) { cout.write (name, i); cout << ‘\n’; i++;}getch ( );}

Output will be

TTeTenTendTenduTendulTendulkTendulkaTendulkar

What are the different ways to indicate the dimensions (row/columns) of an arrayThe dimensions (rows/columns) of an array can be indicated

21

Page 22: XII Tamil Nadu State Board Computer Notes - Vol II

1. using integer constants 2. using const identifier of integer or ordinal3. using char constants 4. using enum identifiers

Write about any two string functions in C++Function Format Purpose and value returnedstrlen() strlen (char *) Returns the number of characters stored in the array. For example

char name[]=”hello” len = strlen(name);The variable len will have the value 5 which is the length of the string name.

strcpy() strcpy (char *,char *) Copies source string to target string. For example,strcpy(name1,name2);where name1 and name2 are strings, then the name2 string will be copied into name1 string

strcmp() strcmp (char *,char *) Compares the two given strings, and returns 0 if strings are equal, value >0, if string 1 is greater than string 2. Otherwise value less than 0. For example, strcmp(“Abc”, “Abc”) returns 0 strcmp (“Abc”, “abc”) returns a value less than 0 strcmp (“abc”, “Abc”) returns a value greater than 0strcmp can be used to arrange a given set of strings in ascending or descending order

Write a note on array of strings with examplesAn array of strings is a two-dimensional character array. The size of first index (rows) determines the number of strings and the size of second index (column) determines maximum length of each string.For example,char day-names [7] [10] = {“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”};An individual string is accessed as day-names [0], i.e., by specifying the 1st index only. A specific character or an element is accessed as day-names [0] [5]

How does an array behave when passed to a function?Arrays can be passed on as arguments to functions. The actual parameter is passed only by the identifier, ignoring dimensions.Array parameters by default behave like a reference parameter, as the array identifier unlike other identifiers, represents the base address of the array. Hence, it results in sending an address to the formal parameter (like reference parameters).

What will be the output of the program?void main() {int a[] = {1,2,3,4,5};for (int i = 0; i<4; i++) a[i+1] = a[i];for(i = 0; i<5; i++) cout << ‘\n’<< a[i];}

Output:11111

Find errorsint a[5.5];

float num[A];

The size of the array has to be a positive integer and cannot be a fraction. Here, 5.5 is a fractional value

The size of array has to be a constant positive integer and not a variable.

22

Page 23: XII Tamil Nadu State Board Computer Notes - Vol II

ONE WORD QUESTIONS

___is a derived data type.__can hold several values of the same type.For handling large data elements belonging to same data type __can be usedAn __ is a collection of variables of same type referenced by a common name.

Array

Array is of __ types: one dimensional and multi-dimensional Two (2)__ array comprises of finite homogenous elements One dimensional__ array comprises of elements, each of which is itself a one- dimensional array Multi-dimensional__dimensional array is suitable for processing list of items of identical types. SingleSize of the array should always be__. zeroarray subscript should always commence from __Process of rearranging data in a given array either in a ascending or descending order is called__.

sorting

Strings are otherwise called as __ literals__are single dimensional array of characters stringscharacter array or string should be terminated with a __ ‘\0’ null characterCin treats __as terminator for string. white space or

carriage return__treats spaces as a part of string literal.__belongs to stdio.h

Gets

__belongs to standard input stream(istream) getlinesyntax for __is gets(char array identifier) or gets(char *) getssyntax for __is cin.getline(char *, no of characters, delimiter); getline__is a member function of standard output stream__has 2 parameters.(identifier, no of characters)

write()

__returns no of characters. strlen()__copies source string to target string. strcpy()__compares two string. strcmp()return value of strcmp() is __when strings are equal 0Value is ___ than 0 if string1 is greater than string2, in strcmp(string1,string2) greaterValue is ___ than 0 if string1 is less than string2, in strcmp(string1,string2) lessnumber of elements in a __is determined by multiplying the no of rows with number of columns

2 dimensional array

__of an array can be indicated using integer, const identifier, ordinal, Char constants, enum

dimensions

A __array is an array in which each element is itself an array. 2-dimensional 2D2-d array is stored in ___memory blocks sequential__of the array is no of elements *memory req. for one element sizeIf the elements are stored in row-wise manner, then this method is called as row-major orderIf the elements are stored in column-wise manner, then this method is called as column-major

orderWhile passing__, actual parameters is passed only by identifier ignoring dimensions

arrays

array parameters by default behave like __parameter referenceThe array identifier represents the __of the array base addressA __is a set of mn numbers arranged in the form of rectangular array of m rows and n columns.__is a 2 dimensional array

matrix

An array of ___is a 2 dimensional character array stringssize of the first index(row) in a string represents number of stringssize of the second index(column) in a string represents __ of each string lengthif null character is not included in a string ___will automatically attach it. compiler

23

Page 24: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 6: CLASSSES AND OBJECTS

IMPORTANT TWO MARKS QUESTIONS

Define class. Give exampleA class is a new way of creating and implementing a user defined data type. Classes provide a method for packing together data of different types. A class is a way to bind the data and its associated functions together.

List the specifications of a class A class specification has two parts:

1) Class declaration 2) Class Function Definitions

Write the general form of class declaration General Form Example

What is data abstraction?Instruments allowing only selected access of components to objects and to members of other classes is called as Data Abstraction. Data abstraction is achieved through data hiding. Data hiding provides security to data.

List out the four characteristics of member function in program development1. Several different classes can use the same function name. The ‘membership’ label will resolve their scope2. Member functions can access the private data of a class. A non-member function cannot do so.3. A member function can call another member function directly, without using the dot operator. (This is called as

nesting of member functions )4. The member functions can receive arguments of a valid C++ data type. Objects can also be passed as

arguments5. The return type of a member function can be of object data type6. Member functions can be of static type

What is meant by array of objects in C++?Arrays of variables of type "class" is known as "Array of objects".

Define data hiding The members and functions declared under private are not accessible by members outside the class, this is referred to as data hiding.

24

Page 25: XII Tamil Nadu State Board Computer Notes - Vol II

What does a class comprise?Class comprises of members. Members are further classified as Data Members and Member functions. Data members are the data variables that represent the features or properties of a class. Member functions are the functions that perform specific tasks in a class.

What are the access specifiers or visibility modes in the class?The three class specifiers or visibility modes in the class body are: private, public and protected

How is memory allocated to an object of a class?The member functions are created and placed in the memory space only when they are defined as a part of the class specification. Since all the objects belonging to that class use the same member function, no separate space is allocated for member functions when the objects are created. Memory space required for the member variables are allocated separately for each object. Separate memory allocations for the objects are essential because the member variables will hold different data values for different objects

Write a note on static data members in C++A data member of a class can be qualified as static. The static member variable Is initialized to zero, only when the first object of its class is created. No other initialization is permitted Only one copy of the member variable is created (as part of the common pool ) and is shared by all the other

objects of its class type Its scope or visibility is within the class but its lifetime is the lifetime of the program.

ONE WORD QUESTIONS

Bjarne Stroustrup initially gave the name for c++ as ‘C with Classes ‘ A ___ is a new way of creating and implementing user defined data type __ is a way to bind data and its associated functions together

class

____ provide a method for packing together data of different types ClassesCLASS DECLARATION and CLASS FUNCTION DEFINITIONS are the TWO parts of Class specificationThe class name is also called as Class tagThe body of a class is enclosed within ___ and is terminatedby a ___

{} braces; semicolon

The class body has ____ access specifiers threeThe access specifiers are also called as ____ visibility labelsThe access specifiers are private , public and

protectedSpecifying _____visibility label or access specifier is optional.By default the members will be treated as ____ if a visibility label or access specifier is not mentioned

private

The members that have been declared as ____, can be accessed only from within the class

___ members are accessible by only its own members and certain special functions called as friend functions

private

The members that have been declared as ___can be accessed from within the class, and the members of the inherited classes.

protected

The members that are declared as ___can be accessed from outside the class also Access allowed by other members in addition to class member & objects

public

The binding of data and functions together into a single entity is referred to as ____ The process of grouping data and its related functions into units called as objects

paves way for ____. The mechanism by which the data and functions are bound together within an object

definition is called as _____

encapsulation

The members and functions declared under private are not accessible by members outside the class is referred to as ___

Data hiding

Instruments allowing only selected access of components to objects and to members of other classes is called as ___

____is achieved through DATA HIDING

Data Abstraction

Class comprises of __ membersMembers are further classified as Data Members and

Member functions ___ are data variables that represent the features or properties of a class ___ are also called as attributes

Data members

25

Page 26: XII Tamil Nadu State Board Computer Notes - Vol II

___ are the functions that perform specific tasks in a class. ___ are called as methods

Member functions

Classes include special member functions called as ___ and ___ constructors and destructors

In C++ the class variables are known as ___ objectsAnother name for the object is Instance of a classThe members of a class are accessed using the ____ operator Dot (.) operatorThe objects declared outside the class cannot access members or functions defined under ____

private or protected

Member functions or methods of a class can be defined in ___ ways:Member function or methods can be declared and defined within the classMember function or methods can be declared within the class but defined outside the class

2

The members defined within the class behave like ___ functions inline functionsMember functions defined outside the class has the prototype as type class_name ::

function name();The ______ (class_name :: ) tells the compiler that the function (function_name) belongs to the class

membership label

The scope resolution operator is ::Several different classes can use the same function name. The ___label will resolve their scope

‘membership’

______ can access the private data of a class. Member functionsA member function can call another member function directly, without using the dot operator is called as

nesting of member functions

The ____can receive arguments of a valid C++ data type. Objects can also be passed as arguments to ____

member functions

The return type of a member function can be of ___ data type object data typeMember functions can be of ___type staticThe ___ are created and placed in the memory space only when they are defined as a part of the class specification.

member functions

No separate space is allocated for ___when the objects are created member functionsMemory space required for the ___ are allocated separately for each object.Separate memory allocations for the objects are essential because the member variables will hold different data values for different objects

membervariables

The ___ is initialized to zero, only when the first object of its class is created (No other initialization is permitted)

static member variable

Only one copy of the ___ is created and is shared by all the other objects of its class type static member variableThe ___of the static member variable is within the class scope or visibilityThe __ of the static member variable is the lifetime of the program lifetimeThe initial value to a static member variable is done outside the class

26

Page 27: XII Tamil Nadu State Board Computer Notes - Vol II

CH 7 POLYMORPHISM

IMPORTANT TWO MARKS QUESTIONS

How are functions invoked in function overloading?The compiler adopts BEST MATCH strategy. As per this strategy, the compiler willo Look for the exact match of a function prototype with that of a function call statement. o In case an exact match is not available, it looks for the next nearest match. That is, the compiler will promote

integral data promotions and then match the call statement with function prototype.

What are the steps in operator overloading? Or What does the process of overloading involve?The process of overloading involves:

o Create a class that defines the data type that is to be used in the overloading operationso Declare the operator function operator () in the public part of the class.o Define the operator function to implement the required operations.

IMPORTANT 5 MARKS QUESTIONS

Define function overloading. (2) Give an example. List the rules for function overloading (2)Function Overloading:The ability of the function to process the message or data in more than one form is called as function overloading

Example for function overloading:To compute area, for different shapes using a single function header can be written in the following manner

float area ( float radius);float area ( float half, float base, float height );float area ( float length , float breadth);

#include<iostream.h>#include<conio.h>

float area ( float radius ){ cout << “\nCircle …”;return ( 22/7 * radius * radius );}

float area (float half, float base, float height){ cout << “\nTriangle ..”;return (half* base*height);}

float area ( float length, float breadth ){ cout << “\nRectangle …”;return ( length *breadth ) ;}

void main() {clrscr();float r,b,h;int choice = 0 ;do {clrscr();cout << “\n Area Menu “;cout << “\n 1. Circle ... “;cout << “\n 2. Traingle ...”;cout << “\n 3. Rectangle ... “;cout <<“\n 4. Exit ... “;cin>> choice;switch(choice) {case 1 : cout << “\n Enter radius ... “; cin>>r; cout<<“\n Area of circle:“<< area(r); getch(); break;case 2: cout<< “\n Enter base, height ... “; cin>>b>>h; cout<<“\n Area of triangle:“<< area (0.5, b, h); getch(); break;case 3: cout<< “\n Enter length, breadth.. “; cin>>h>>b; cout<<“\n Area of rectangle:“ << area(h,b); getch(); break; }}while (choice <=3);}

Rules for function overloading1) Each overloaded function must differ either by the number of its formal parameters or their data types2) The return type of overloaded functions may or may not be the same data type3) The default arguments of overloaded functions are not considered by the C++ compiler as part of the parameter list

4) Do not use the same function name for two unrelated functions

27

Page 28: XII Tamil Nadu State Board Computer Notes - Vol II

What is operator overloading? (2) Give an example of operator overloading. List the rules of operator overloading(2)Operator Overloading:

The term operator overloading, refers to giving additional functionality to the normal C++ operators like +,++,-,—,+=,-=,*.<,>. The statement sum = num1 + num2 would be interpreted as a statement meant to perform addition of numbers (integer/float/double) and store the result in the variable sum.

Example of operator overloading:# include <iostream.h># include <conio.h># include <string.h>class strings {char s[10];public : strings() { s[0] = ‘\0’;}strings(char *c) {strcpy(s,c);}char * operator+(strings x1) {char *temp;strcpy(temp,s);strcat(temp,x1.s);return temp;}};

void main(){clrscr();strings s1(“test”), s2(“ run\0”);char *concatstr ;concatstr = s1 + s2;cout << “\nConcatenated string ...” << concatstr;getch();}

operator overloading provides:o Operator overloading provides New function definitions for basic C++ operators like +, *, -, ++, - -, >, <, +=

and the like. One cannot overload C++ specific operators like membership operator (.), scope resolution operator (::), sizeof operator and conditional operator.

o The overloaded function definitions are permitted for user defined data type.o Operator functions must be either member functions or friend functions. o The new definition that is provided to an operator does not overrule the original definition of the operator.

For example, if the ‘+’ operator has been used to merge two strings, one can also perform addition of numbers in the usual way. The compiler applies user defined definition based on the style of call statement.

Rules for operator overloading:

28

Page 29: XII Tamil Nadu State Board Computer Notes - Vol II

Only existing operators can be overloaded. New operators cannot be created.

The overloaded operator must have at least one operand of user defined type._ The basic definition of an operator cannot be replaced or inother words one cannot redefine the function of an operator.One can give additional functions to an operator_ Overloaded operators behave in the same way as the basicoperators in terms of their operands._ When binary operators are overloaded, the left hand objectmust be an object of the relevant class_ Binary operators overloaded through a member function takeone explicit argument.

ONE WORD QUESTIONS

This differential response of a function based on different inputs is ___ polymorphism

The ability of an object to respond differently to different messages is _ polymorphism___ reduces software complexity as multiple definitions are permitted to an operator or function

polymorphism

Polymorphism is achieved in ___ ways 2polymorphism is achieved through ___ and ___ Function overloading

and operator overloading

___ is one of the facets of C++ that supports object oriented programming Function overloadingThe term ___means a name having two or more distinct meanings overloadingThe ability of the function to process the message or data in more than one form is called as

function overloading

An ___ refers to a function having more than one distinct meaning overloadedfunction

The compiler adopts ___ strategy in function overloading BEST MATCH_____ are purely compiler oriented Integral promotionsEach ___ must differ either by the number of its formal parameters or their data types

Overloaded functions

The return type of ____may or may not be the same data type Overloaded functionsThe parameter list in ___differ either by number or types. Overloaded functionsThe term ___refers to giving additional functionality to the C++ operators operator overloadingThe functionality of ‘+’ operator can be extended to strings through ___ operator overloading___ provides new function definitions for basic C++ operators like +, *, -, ++, - -, >, <, +=

operator overloading

Operator functions must be Member functions or friend functions

The __ operators cannot be overloaded C++ Specific operatorsThe C++ specific operators which CANNOT be overloaded are: membership operator

(.), scoperesolution operator (::), sizeof operator and conditionaloperator.

The process of operator overloading involves the declaration of the operator function ____ in the public part of the class.

operator ()

Only ___can be overloaded existing operatorsThe overloaded operator must have at least __operand of user defined type. oneThe basic definition of an ___cannot be replaced operatorone cannot redefine the function of an ___ operatorWhen ___are overloaded, the left hand object must be an object of the relevant binary operators

29

Page 30: XII Tamil Nadu State Board Computer Notes - Vol II

class___ overloaded through a member function take one explicit argument binary operators

30

Page 31: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 8: CONSTRUCTORS AND DESTRUCTORS

IMPORTANT TWO MARKS QUESTIONS

What are constructors and destructors?When an instance of a class comes into scope, a special function called the constructor gets executed. The constructor function initializes the class object. When a class object goes out of scope, a special function called the destructor gets executed. The constructor function name and the destructor have the same name as the class tag.

List the functions of constructorThe functions of constructor are:1) The constructor function initializes the class object2) The memory space is allocated to an object

Give two rules for constructor definition and usageThe rules for constructor definition and usage are:1) The name of the constructor must be same as that of the class2) A constructor can have parameter list or arguments3) The constructor function can be overloaded4) The compiler generates a constructor, in the absence of a user defined constructor5) The constructor is executed automatically6) constructor cannot have return type

Write down four rules for definition and usage of destructor1) The destructor has the same name as that of the class prefixed by the tilde character ‘~’.2) The destructor cannot have arguments3) It has no return type4) Destructors cannot be overloaded i.e., there can be only one destructor in a class5) In the absence of user defined destructor, it is generated by the compiler6) The destructor is executed automatically when the control reaches the end of class scope

Tabulate any two differences between constructor and destructorConstructor DestructorThe name of the constructor must be same as that of the class

The destructor has the same name as that of the classprefixed by the tilde character ‘~’.

A constructor can have parameter list Destructor cannot have parameter listThe constructor function can be overloaded Destructor function cannot be overloaded

When is copy constructor executed?A copy constructor is executed:1) When an object is passed as a parameter to any of the member functions Example void add::putdata( add x);2) When a member function returns an object For example, add getdata();3) When an object is passed by reference to constructor For example, add a; b(a);

ONE WORD QUESTIONS

When an instance of a class comes into scope a special function called __gets executed. constructor___function initializes class object. Constructorwhen a class object goes out of scope, special function called __gets executed. destructorNon parameterized constructor is called as ___constructor. default__constructors are referred to compiler generated constructors (i.e., constructors defined by the computers in the absence of user defined constructor).

default

A __constructor is executed when an object without parameters is declared. non-parameterizedThe constructor add (int s1, int s2) is called as __constructor. parameterizedThe constructor add (add &a) is called as ___constructor. copy__is executed

when an object is passed as a parameter when a member functions returns an object an object is passed by reference to constructor

copy constructor

Name of the constructor must be same as that of the ___ class___ generates constructor in the absence of a user defined constructor. compiler__is a function that removes memory of an object__is prefixed with tilde.__ cannot have arguments and has no return type__ is executed automatically when the control reaches the end of the class scope

Destructor

31

Page 32: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 9: INHERITANCE

IMPORTANT 2 MARKS QUESTIONS

List the types of inheritanceThere are different types of inheritance:Single Inheritance Multiple inheritance Multilevel inheritanceHybrid inheritance Hierarchical inheritance

Write a note on single inheritance, multilevel inheritance and multiple inheritance (each 2 marks)

Single Inheritance:When a derived class inherits only from one base class, it is known as single inheritance.

Multiple Inheritance:When a derived class inherits from multiple base classes it is known as multiple inheritance

Multilevel inheritance:When a class is derived from a class which is a derived class itself – then this is referred to as multilevel inheritance The transitive nature of inheritance is reflected by this form of inheritance.

Write the syntax for deriving a class from its base classThe syntax for deriving a class from its base class is:

class der_name : visibility mode base class-id{ data members of the derived_class functions members of derived_class}

Example:

What is an abstract class?

32

Page 33: XII Tamil Nadu State Board Computer Notes - Vol II

Classes used only for deriving other classes are called as Abstract Classes ie., to say that objects for these classes are not declared.

What are the three access specifiers used to inherit a derived class?The three access specifiers used are private, protected and public.

What is accessibility?An important feature in Inheritance is to know as to when a member of a base class can be used by the objects or the members of the derived class. This is called as accessibility. The three access specifiers are private, protected and public. Access specifier is also referred to as visibility mode. The default visibility mode is private.

IMPORTANT 5 MARKS QUESTIONS

Define inheritance. Explain the advantages of inheritance in detail.Inheritance:Inheritance is a process of creating new classes called derived classes, from the existing or base classes. The derived class inherits all the properties of the base class Inheritance is the most powerful feature of an object oriented programming language. It is a power packed class, as it can add additional attributes and methods and thus enhance its functionality.Advantages of Inheritance:1) Reusability of code : Many applications are developed in an organization. Code developed for one application can be reused in another application if such functionality is required. This saves a lot of development time.2) Code sharing : The methods of the base class can be shared by the derived class.3) Consistency of interface: The inherited attributes and methods provide a similar interface to the calling methods. In the example below, the attributes and methods of the class vehicle are common to the three derived classes – Aeroplane, Car and Bicycle. These three derived classes are said to be having a consistence interface.

Explain the scope and accessibility of the base members in the derived classes

33

Page 34: XII Tamil Nadu State Board Computer Notes - Vol II

When a base class is inherited with private visibility mode the public and protected members of the base class become ‘private’ members of the derived classWhen a base class is inherited with protected visibility mode the protected and public members of the base class become ‘ protected members ‘ of the derived classWhen a base class is inherited with public visibility mode , the protected members of the base class will be inherited as protected members of the derived class and the public members of the base class will be inherited as public members of the derived class

ONE WORD QUESTIONS

__is the process of creating new classes called derived classes from the existing class called base class

Inheritance

__class is a class from which other classes are derived. Base__class is a power packed class that inherits the members of the base class. Derived__saves a lot of development time. Reusability of codeCode sharing is the method of sharing the base class methods by the __class. derivedInherited attributes and methods provide a similar interface to __methods. calling__is knowing when a member of a base class can be used by the objects or the members of the derived class.

Accessibility

Access specifiers are also called as __ visibility modeThe three access specifiers are__. private, protected

and publicdefault visibility mode is __ privatewhen a base class is inherited with private visibility mode, public and protected members of the base class become __of the derived class

private members

when a base class is inherited with protected visibility mode, public and protected members of the base class become __of the derived class

protected members

when a base class is inherited with public visibility mode, protected members of the base class become __of the derived class

protected members

when a base class is inherited with public visibility mode, public members of the base class become __of the derived class

public members

When classes are inherited publicly, protectedly or privately, the __of the base class are not inherited, but they are only visible

private members

__of base class are not inherited but executed when an instance of the derived class is created.

Constructors

When a derived class inherits only from one base class it is called__. single inheritanceWhen a derived class inherits from multiple base classes it is known as __ Multiple inheritanceThe transitive nature of inheritance is reflected by __inheritance multilevel

34

Page 35: XII Tamil Nadu State Board Computer Notes - Vol II

When a class is derived from a class which is a derived class itself it is called __. Multilevel inheritanceclasses used only for deriving other classes are called __ abstract classes_are executed in the order of inherited class. i.e from base constructor to derived Constructors___are executed from derived class to base class destructors

35

Page 36: XII Tamil Nadu State Board Computer Notes - Vol II

CHAPTER 10: IMPACT OF COMPUTERS

IMPORTANT 2 MARKS QUESTIONS

What is meant by e-banking?e-Banking permits banking from the comfort of the home by using internet facilities. It has truly improved the reach and services of banks.

What is ATM?Advanced machines like ATM enable withdrawal of money from the accounts in a particular bank anytime and anywhere. This helps the user in emergency situations where money is needed during the nights and holidays. However, the user has to go to the nearest ATM facility.

What are meant by emotion containers?Emotion containers are small compartments with a screen, speaker and a scent to derive emotional comfort. This can prevent people from acquiring bad habits

What is meant by e-learning?e-Learning enables online educational programs leading to degrees and certifications. e-Learning uses technology to enable people to learn anytime and anywhere

How are computers used in education?Computers are used in many areas of Education including:

Buying and browsing the latest edition of books by both local and foreign author Educational CDROMs Computer Based Tutorials (CBT). Spreading information about schools, colleges, universities and courses offered, admission procedures,

accommodation facilities, scholarships, educational loans, career guidance. e-Learning that enables online educational programs leading to degrees and certifications

ONE WORD QUESTIONSTo reach out the benefits of IT to the common man, we need __ technical elements: Connectivity, Affordable computers and Software

3

__ of computer usage is word processing 85%__enables data storage and management. Archive unit__are small compartments with screen, speaker and scent to derive emotional comfort.__prevents people from acquiring bad habits.

Emotion containers

_is used to store personal details and enable connectivity to other people. Personal archive__features allow one to sing along with the audio coming from the original source. Kara-oke__functions as electronic pets. RobotsEasy interaction with other people through touch screen, scanner and microphone facilities is called__.

memo frame

__is used to draw capture and work with multimedia elements. Personal creativity toolBanks are the key factor in the __ national economyCBT is an acronym for: computer based

tutorials__provides banking from the comfort of the home by using internet facilities. E-banking__enables online educational programs leading to degree and certification. E-learning__help farmers plan which crops will produce the highest profits revenue estimators___is used to decide on the crops. Satellite imagery

36

Page 37: XII Tamil Nadu State Board Computer Notes - Vol II

Chapter 11: IT ENABLED SERVICES (ITES)

IMPORTANT 2 MARKS QUESTIONS

What is meant by IT Enabled service?Information Technology that helps in improving the quality of service to the users is called IT Enabled Services [ITES]. IT Enabled Services are human intensive services that are delivered over telecommunication networks or the Internet to a range of business segments.

List some of the IT Enabled servicesSome of the IT enabled services are: e-Governance Call Centers Data Management Medical [Telemedicine and

Transcription]. Data Digitization Website Services

What is meant by call center?A call center is sometimes defined as a telephone based shared service center for specific customer activities and are used for number of customer-related functions like marketing, selling, information transfer, advice, technical support and so on. A call center has adequate telecom facilities, trained consultants, access to wide database, Internet and other on-line information support to provide information and support services to customers. It operates to provide round the clock and year round service i.e.24 x 365 service.

What is meant by digitization?Digitization refers to the conversion of non-digital material to digital form. A wide variety of materials as diverse as maps manuscripts, moving images and sound may be digitized.Digitization offers great advantages for access, allowing users to find, retrieve, study and modify the material. However, reliance on digitization as a preservation strategy could place much material at risk. Digital technologies are changing rapidly. Preservation is a long term strategy and many technologies will become obsolete soon. This instability in technology can lead to the loss of the digitized objects.

What are the application areas of digitization?Some application areas of the digital technology are as follows:

Annual reports and price list Books Data Management Electronic Catalogues & Brochures Engg. & Design Geographical Information

System Movies, Sounds and High quality

image preservation Product/Service

Training Manuals Research Journals and

Conference Papers

What are the steps in digitization?The steps in data digitization are:

Understanding the customer needs Customer needs are used as the basis for defining the objectives of digitization A pilot application is built After the pilot application is approved, the full digitization of data identified by the customer is undertaken. Different types of data are digitized using different techniques. Many advance software packages are

available to improve the quality of the digitized form of the original document. The digitized data is indexed and a table of contents is produce to improve accessibility. Highly advanced

and reliable storage facilities are used to stock the digitized data.

What are the benefits of digitization?There are many benefits of digitization. Some of the key benefits are:

1) Long term preservation of the documents.2) Storage of important documents at one place.3) Easy to use and access to the information.4) Quick and focused search of relevant information in terms of images and text.5) Easy transfer of information in terms of images and text.6) Easy transfer of information through CD-ROM, internet and other electronic media

Give the importance of ITES ITES greatly increases the employment opportunities. ITES can improve the quality of the service either directly or indirectly. Improved customer satisfaction, better

look and feel and an improved database are some direct benefits. Indirect benefits are seen after sometime. Data collected for one purpose may be useful for some other purpose also after some time.

In what way e-Governance can help us?Computers help you to look at the government websites and the services provided by them. The various websites provided by the government give the details about the departments, specific functions, special schemes, documents,

37

Page 38: XII Tamil Nadu State Board Computer Notes - Vol II

contacts, links, IAS intranet, site map, search, what’s new, press releases, feedback. These websites are both in English and Tamil.

ONE WORD QUESTIONS

The facility that allows the user to speak into a special device called ___ DictaphoneThe expansion for BPO is ____ Business Process

Outsourcing___help us to look at the government and services provided by them. e governanceA ____ is a telephone based shared service center for specific customer activities. call center___is a category of ITES pertaining to collection, digitization and processing of data coming from various sources.

data management

____ is the key for effective and profitable used of IT in organization. data managementBanking , Financial Services and insurance sectors are popularly termed as __ BFSI___ and __ are two important aspects that must be ensured by the ITES provider. Data Security

customer privacy___is a permanent , legal document that formally states the result of a medical investigation.

Medical transcription

There are __main steps involved in medical transcription. threeThe conversion of non-digital material to digital form is __ digitization

38

Page 39: XII Tamil Nadu State Board Computer Notes - Vol II

Chapter 12: COMPUTER ETHICS

IMPORTANT TWO MARKS QUESTIONS

Define piracyMaking and using duplicate hardware and software is called piracy. We tend to pirate because:

1) We like free things2) Why pay for something when we can get it for free?3) Our thinking and actions are self-serving4) If we have the opportunity to get away with something, benefit financially, and minimal risk is involved, the

way in which we’ve been conditioned by our capitalist society to do it.

What is meant by theft of computer time?Most of the computers in an organization have lot of free computer time to spare. Many solutions for using this spare time are being researched. However, this idle time of computers in an organization is being stolen illegally. Some other software runs on an idle computer without the knowledge of the organization. This is called theft of ‘computer time’.

Define computer ethicsEthics is the set of rules for determining moral standards or what is considered as socially acceptable behaviours. Today, many computer users are raising questions on what is and is not ethical with regard to activities involving information technology. General guidelines on computer ethics are needed for:

Protection of personal data Computer Crime Cracking

Define computer crimeA computer crime is any illegal activity using computer software, data or access as the object, subject or instrument of the crime. Common crimes include:

Crimes related to money transfer on the internet Making long distance calls illegally using computers Illegal access to confidential files Stealing hardware Selling or misusing personal

Hardware and software piracy Virus Cracking Theft of computer time

Define virusA virus is a self-replicating program that can cause damage to data and files stored on your computer. These are programs written by programmers with great programming skills who are motivated by the need for a challenge or to cause destruction. 57000 known virus programs are in existence. 6 new viruses are found each day.

Write a note on crackingCracking is the illegal access to the network or computer system. Illegal use of special resources in the system is the key reason for cracking. The resources may be hardware, software, files or system information. Revenge, business reasons and thrill are other common reasons for committing this crime.

What is the need for a password to log into a computer system?User Id and passwords are tools that offer personal security that refers to software setups that permit only authorized access to the system. Only those with a need to know have Ids and password for access to log into a computer system

ONE WORD QUESTIONS___refers to the protection of hardware, facilities magnetic disks etc., physical security___ refers to software setup that permits only authorized access to the system. personal security____ refers to protecting data and computer system against dishonesty or negligence of employees.

Personnel security

___ is any illegal activity using computer software data or access as the object, subject or instrument of the crime.

Computer crime

Making and using duplicate hardware and software is called __ piracy___is a self-replicating program that causes damage to data and files stored on our computer.

virus

___is a program written by programmers to cause damage to data and files stored. virusSome other software runs on an idle computer without the knowledge of the organization is called theft of ___

computer time

The ‘Ten commandments of Computer Ethics ‘ written by __ computer ethics institute

India has ___ to prevent computer crimes. cyber laws__ is the illegal access to the network or computer system. cracking__ use of special resources in the system is the key reason for cracking illegalHow many virus programs are in existence 57000How many viruses are found each day 6

39

Page 40: XII Tamil Nadu State Board Computer Notes - Vol II

___ and ____have created the condition where people can take their work anywhere with them and do it any time.

Portable computers and telecommuting

Computer ethics has its roots in the work of ___ during World War II. Norbert Wiener___ percent of computer crimes happen within the company out of which 60% goes undetected

80%

In which year was formal course in ethics introduced 1990sIn the mid 1960s, ____ began to examine unethical and illegal uses of computers by computer professionals.

Donn Parker of SRI International in Menlo Park, California

40