ࡱ> (  h i j k l m n o p q r s t u v w x y z { | } ~  SUY.Hl  bjbjVV L<<XLDD''_3_3_3$333P3L< 3+TXZFZZZSP!RR`@_3yi6SPyy''ZZx]]]yޠ'Z(_3Z]y]] jr< 0LZ_* 3/{͓0|N՛I՛J՛_30=Sb _]who =S=S=S\=S=S=Syyyy՛=S=S=S=S=S=S=S=S=SD M&: KENDRIYA VIDYALAYA SANGATHAN JAMMU REGION .  STUDY/SUPPORT MATERIAL 2011-12 CLASS: XII Computer Science ACKNOWLEDGEMENTS Chief Patron Shri Avinash Dikshit Commissioner KVS, New Delhi Patron Shri P. K. Koul Assistant Commissioner KVS, Jammu Region Guidance Shri Y. P.Singh Education Officer KVS, Jammu Region Shri K. S. Yadav Education Officer KVS, Jammu Region STUDY/SUPPORT MATERIAL PREPARATION COMMITTEE Co-ordinator Dr. Chitra Mishra Principal, KV No.1 Jammu Members: 1. Sh. Arun Kumar PGT(Comp.Sc.), KV No.1 Jammu 2. Sh. Ramesh Chand Thakur PGT(Comp.Sc.), K.V. Lakhanpur 3. Sh. Barinder Singh PGT(Comp.Sc.), K.V.2 Udhampur 4. Sh. Shiv Pratap Pal PGT(Comp.Sc.), K.V.No.1, Akhnoor STUDY/SUPPORT MATERIAL REVIEW COMMITTEE Co-ordinator Smt. Vinita Parsheera I/c Principal KV No.1 Jalandhar Members: Mrs. Swati Agarwal PGT (Computer Science), KV No.1 Jalandhar Sh. Umed Ali PGT (Computer Science), KV No.4 Jalandhar SUPPORT MATERIAL COMPUTER SCIENCE 2011-12 CBSE Mark Distribution for different Topics (Important Lessons) SlNoUnit NameMarks1UNIT 1 Programming in C++302UNIT 2 Data structures143UNIT 3 Database and SQL084UNIT 4 Boolean Logic085UNIT 5 Communication and open source concept10Total Marks70 Weightage to different topics/content units Sr. No.TopicMarks1Review of C++ covered in Class XI122Object oriented programming in C++123Data Structure & Pointers144Data File Handling in C++065Databases and SQL086Boolean Algebra087Communication and Open Source Concepts10Total70 Weightage to different forms of questions S. No.Forms of QuestionMarks for each questionNo. of QuestionsTotal Marks1Very Short Answer Questions (VSA)0109092Short Answer Questions- Type 1 (SA1)0213263Short Answer Questions- Type II (SAII)0305154Long Answer Questions- (LA)040520Total3270 Difficulty Level of Questions S. N.Estimated Difficulty LevelPercentage of questions1Easy15%2Average70%3Difficult15% INDEX S.No.Topics PAGE NO.1Overview of C++52Basic Concepts of OOP & Classes and Objects113Data File Handling254Pointers325Data Structures Arrays Stacks Queue436Database And SQL707Boolean Algebra838Communication And Open Source Concepts949Question Paper with Solution (March-2011)111 Overview of C++ KEY POINTS: Introduction to C++ C++ is the successor of C language & developed by Bjarne Stroustrup at Bell Laboratories, New Jersey in 1979. Tokens- smallest individual unit. Following are the tokens Keyword-Reserve word that cant be used as identifier Identifiers-Names given to any variable, function, class, union etc. Literals-Value of specific data type Variable- memory block of certain size where value can be stored and changed. Constant- memory block where value can be stored once but cant changed later on Operator performs some action on data Arithmetic(+,-,*,/,%) Relational/comparison (<,>,<=,>=,==,!=). Logical(AND(&&),OR(||),NOT(!). Conditional (? :) Increment/Decrement Operators( ++/--) Precedence of operators: ++(post increment),--(post decrement)Highest  Low ++(pre increment),--(pre decrement),sizeof !(not),-(unary),+unary plus)*(multiply), / (divide), %(modulus)+(add),-(subtract)<(less than),<=(less than or equal),>(greater than), >=(greater than or equal to)==(equal),!=(not equal)&& (logical AND)||(logical OR)?:(conditional expression)=(simple assignment) and other assignment operators(arithmetic assignment operator), Comma operatorData type- A specifier to create memory block of some specific size and type. For example int,float,double,char etc. cout It is an object of ostream_withassign class defined in iostream.h header file and used to display value on monitor. cin It is an object of istream_withassign class defined in iostream.h header file and used to read value from keyboard for specific variable. comment- Used for better understanding of program statements and escaped by the compiler to compile . e.g. single line (//) and multi line(/*.*/) Control structure : Sequence control statement(if)conditional statement (if else)case control statement (switch case)loop control statement (while ,do while, for)SyntaxSyntaxSyntaxSyntaxif(expression) { statements; } If(expression) { statements; } else { statements; }switch(integral expression) {case (int const expr1): [statements break;] case (int const expr2): [statements, break;] default:Statements;}while(expression) {statements;} do .while loop do {statement;} while(expression); for loop for(expression1;expression2;expression3) {statement;}Note: any non-zero value of an expression is treated as true and exactly 0 (i.e. all bits contain 0) is treated as false. Nested loop -loop within loop. exit()- defined in process.h and used to leave from the program. break- exit from the current loop. continue- to skip the remaining statements of the current loop and passes control to the next loop control statement. goto- control is unconditionally transferred to the location of local label specified by . For example A1: cout< int MyClass(int); void main( ) {int x; cout << \n Enter the Input Value: ; cin>>x; cout<<\n The Output is: << MyClass(x); } inline int MyClass(int x1) {return 5*x1;} The output of the above program is: Enter the Input Value: 10 The Output is: 50 The output would be the same even when the inline function is written solely as a function. The concept, however, is different. When the program is compiled, the code present in the inline function MyClass ( ) is replaced in the place of function call in the calling program. The concept of inline function is used in this example because the function is a small line of code. The above example, when compiled, would have the structure as follows: #include int MyClass(int); void main( ) {int x; cout << \n Enter the Input Value: ; cin>>x; //The MyClass(x) gets replaced with code return 5*x1; cout<<\n The Output is: << MyClass(x); } #include int MyClass(int); void main( ) {int x; cout << \n Enter the Input Value: ; cin>>x; //Call is made to the function MyClass cout<<\n The Output is: << MyClass(x); } int MyClass(int x1) {return 5*x1;} 1 Marks questions Name the header files that shall be needed for the following code: void main( ) { char word[]=Board Exam; cout< void main( ) { F = 10, S = 20; test(F;S); test(S); } void test(int x, int y = 20) { x=x+y; count<>y; } Find the output of the following program: #include void main( ) { int U=10,V=20; for(int I=1;I<=2;I++) { cout<<[1]< class FLIGHT { Long FlightCode; Char Description[25]; public void addInfo() { cin>>FlightCode; gets(Description);} void showInfo() { cout< #include void main( ) { randomize( ); char City[ ][10]={DEL, CHN, KOL, BOM, BNG}; int Fly; for(int I=0; I<3;I++) {Fly=random(2) + 1; cout< #include void main( ) { randomize( ); int Score[ ] = {25,20,34,56,72,63},Myscore; cout< void test(int x,int y=20); //Prototype missing void main( ) { int F = 10, S = 20; //Data type missing Text(F,S); //Comma to come instead of ; Text(S);} void Text(int x, int y) { x=x+y; cout< class FLIGHT { long FlightCode; char Description[25]; public: void addInfo() { cin>>FlightCode; gets(Description);} void showInfo() { cout<