Dr. P.S. Ahluwalia (Course Director) In Service Course 2009 For PGT (Comp. Sci) K.V.No.2, Jaipur

Size: px
Start display at page:

Download "Dr. P.S. Ahluwalia (Course Director) In Service Course 2009 For PGT (Comp. Sci) K.V.No.2, Jaipur"

Transcription

1 Study Material Class XII (Comp.Sc.) :: ::

2 Rapid and major metamorphoses in the realm of the Computer world affected every dimension of our life. Today we are living into an Information age and modern IT practices is shaping our children. Children today need free access to technology and guidance in the responsible and effective use of the technology. The influence of technology forced CBSE to introduce Computer Science, Informatics Practices and Web Technologies at Senior Secondary Level. This booklet is specially designed tool for slow learners to cope with the complexity of the subject. It covers all the most relevant topics and questionnaires in the light of CBSE Examination. This book is outcome of In-service Course-2009 for PGT (Computer Science) conducted at K.V.No.2, Jaipur. I am very much thankful to Dr. K.P. Chamola, Assistant Commissioner, KVS, and Sri H.C. Chawala, Education Officer, Kendriya Vidyalaya of Jaipur Region for providing the opportunity to conduct In-service Course for PGT (Computer Science) in this Vidyalaya. I am also thankful to Mr. Aslam Parvez (Associate Director), Mr. Sanjay Gupta, Mr. Y. Rohilla, being the Resource Persons and all the PGT Comp.Sci who have attended the In-Service Course-2009, without whose contribution and assistance this material would not have seen the light of the day. Dr. P.S. Ahluwalia (Course Director) In Service Course 2009 For PGT (Comp. Sci) K.V.No.2, Jaipur Study Material Class XII (Comp.Sc.) :: 2::

3 Table of Contents. C++ Revision Tour 3 2. Object Oriented Programming 0 3. Function Overloading 3 4. Classes and Objects 5 5. Constructors and Destructors 2 6. Inheritance Arrays 3 8. Database Concepts and SQL Boolean Algebra Data Communication & Network Concepts 55 Study Material Class XII (Comp.Sc.) :: 3::

4 Chapter : C++ Revision Tour Key Points Variables:-Variables represent named storage location whose values can be manipulated during program run. For eg. int A; A is a variable name that will be use to store an integer value. Keywords: The keywords are also identifiers but can not be user defined since they are reserved words. For eg: int,float, void etc are keywords that have special meaning. Data types:- Data types are means to identify the type of data and associates operation for handling it. There are two types of data types: Fundamental data types, Derived data types Fundamental data types are int, float, char, double Derived Data types:- From the fundamental types other can be derived by using the declaration operators. Ex: Array, structure and Pointer. Operators in c++ The symbols that perform some predefined operation on operands. There are five types of operators: Arithmetic Operators: +, -, *, /, % Relational Operators: >, <, >=, <=,!=, == Assignment Operators: = Increment/Decrement Operators: ++, -- Logical operator : &&,,! Flow of Control To control the flow of the program there are three types of statements are used these are Selection Statements, Iteration Statements, Jumping Statements Selection Statements: - These types of statements are only used for decision making. There are two types of selection statements named if(two way branching), switch(multiway branching. Iteration Statements: - The iteration statement allows a set of instructions to be performed until a certain condition is fulfilled. It is also called loop. There are three types of loops as follows:- for, while, do For loop:-for loop is used to repeat a set of statements for specified no. of times. All the three parts i.e, initialization, condition checking, increment and decrement operations of the loop are listed in one line. While loop: while loop is used when we want to repeat a set of statements till a particular condition is true. In case of while we have to put all the three parts in different lines. Do..while loop: In case of Do while loop first the body of the loop will be executed and then the expression will be evaluated. Now if the expression is evaluate to true then the body of the loop will be executed again otherwise the control will move out of the loop body. Jumping: The jump statements unconditionally transfer control anywhere in the program. There are three types of jumping statements as follows: goto, break, continue goto:-the goto statement is used to alter the program sequence by transferring the control to some other part of the program. break: The break statement is used to break the loop statements or switch-case statement and the control comes out of the loop. Study Material Class XII (Comp.Sc.) :: 4::

5 Arrays continue: continue statement is used to skip the current iteration and continue with next iteration Array is a collection of homogenous data type under the same name and stored in the continue manner. There are two types of array as follows Structure Single Dimensional Array: The simplest form of array is single dimensional arrays. An array definition specifies a variable name along with size to specify how many data items the array will contains. Syntax: datatype array-name[size]; Mutiple Dimensional Array: Where we specify two or more dimension. Ex: A 2D array is used to store matrix. Structure is a collection of variables under a single name. Variables can be of any data type: int, float, char etc. The main difference between structure and array is that arrays are collections of the same data type and structure is a collection of variables may be of different types under a single name. Example: Functions A function is a named unit of a group of programs statements. This unit can be invoked from other parts of the program as and when required. The general form of a fiunction definition is as given below: type function-name (parameter list) body of the function Parameters can be passed to function in two manners: call by value and call by reference. The call by value method copies the values of actual parameters into the formal parameters, that is, the function creates its own copy of argument values and then uses them. When a function is called by reference, then, the formal parameters become references to the actual parameters in the calling function. Study Material Class XII (Comp.Sc.) :: 5::

6 Questions and Answers 2 Mark Questions Q. Difference between Global and Local variable. Ans Local variable:- The local variable are the variable that are only accessible by the block of code in which it declared. These variables are also called private variables. Global Variable:-Global variables are the variables that are accessible in entire program. Global variable have global scope. Q.2 Difference between entry control and exit control loop. Ans Entry control Loop: In the case of entry control Loop first the loop expression will be checked and then the body of the loop will be executed. Example: for Loop, while Loop Exit control Loop: in the case of exit control loop first the body of the loop will be executed then the given expression will be checked. It means that the body of the loop will execute atleast once. Example: do..while loop. Q.3 what is the difference between # define and Const? Ans Both #define and const define constants, however #define can define simple constants without considering datatype, whereas const can define almost any type of constant, including constant objects of structure and classes. Q.4 Define the typedef Command with example. Ans typedef command defines a new name or an alias name for an existing type. For example, all transactions generally involve amounts which are of double type, so for a bank application, we can safely provide an alias name as amount to predefine double type, we will write typedef double amount. Now we can define any amount using the data type amount as amount loan,balance; Q.5 Differentiate between Logical error and Syntax error, with suitable example. Ans Logical Error: Logical error is an error which occurs because of wrong interpretation of logic. For Example: if by mistake we divide a number with zero. Syntax Error: A syntax error is the error that occurs when statements are wrongly written violating rules of the programming language. For example: Missing Semicolon. wrong use of Keywords. Q.6 What is ternary operator? Is there any ternary operator available in C++? Which? Ans A ternary operator requires three operands. C++ has only one ternary operator or conditional operator i.e?: The syntax of conditional operator is : (Conditional expression)? expression : expression 2; it replaces simple if else statement. Ex: large=(a>b)?a:b; Q.7 Differentiate between break and continue statements. Ans break: The break statement terminates the loop and come out of the loop. For this purpose break keyword is used. continue: continue statement forces the next iteration of the loop to take place, skipping the current iteration. For this purpose continue keyword is used. Study Material Class XII (Comp.Sc.) :: 6::

7 Q. 8(a) Name the Header file(s) that shall be needed for successful compilation of the following C++ code void main() int a[0]; for (int i=0;i<0;i++) cin>>a[i]; if(a[i]%2==0) a[i]=pow(a[i],3); else a[i]=sqrt(a[i]); if(a[i]>32767) exit(0); getch(); Ans iostream.h, math.h, process.h, conio.h Q. 9. Name the header files to which the following belong : (i) puts ( ) (ii) isalnum ( ) (iii) abs( ) (iv) strcmp( ) Ans (i) stdio.h (ii) ctype.h (iii) math.h (iv) string.h Q.0. Name the header file of C++ to which following functions belong: (i) strcat() (ii) scanf() (iii) getchar() (iv) clrscr()ans (i) string.h (ii) stdio.h (iii) stdio.h (iv) conio.h Q.. Name the header files that shall be needed for the following void main( ) char String[ ] = Peace ; cout << setw(2)<<string; Ans (i) iomanip.h (ii) iostream.h Q2. Write a structure specification that includes two structure variables-distance and time. The distance includes two variables both of type float called feet and inches. The time includes three variables all of type int called hrs, mins and secs. Intialise such a structure with values feet, 8.5 inches, 0 hrs, 5 mins, 7 secs. Ans struct distance float feet; float inches; struct time ; int hrs; int mins; int secs; ; struct tour distance d; time t; ; tour t=345.00,8.5,0,5,7; Q3. Write structure definition for structure containing the following: (i) rollno, name, grade. (ii) bookno, bookname, auther, price. Ans struct stud Study Material Class XII (Comp.Sc.) :: 7::

8 int rollno; char name[20]; char grade; ; struct book int bookno; char bookname[30]; char author[20]; int price; ; Q4 Ans What is the difference between call by value and call by reference. call by value method copies the values of actual parameters into the formal parameters, that is, the function creates its own copy of argument values and then uses them. So any change in formal parameters won t be visible in calling function. Whereas When a function is called by reference, then the formal parameters become references to the actual parameters in the calling function. Q5 Find the output of the following program : #include<iostream.h> struct MyBox int length, breadth, height; ; void Dimension(MyBox M) cout<<m.length<< x <<M.breadth<< x <<M.height; void main() MyBox B=0,5,5,B2,B3; ++B.height; Dimension(B); B3=B; ++B3.lenght; B3.breadth++; Dimension(B3); B2=B3; B2.height+=5; B2.lenght--; Dimension(B2); Ans 0 x 5 x 6 x 6 x 6 0 x 6 x Q6 find the output of the following program: #include<iostream.h> void main() int U=0,V=20 for(int i=;i<=2;i++) cout<< [] <<U++<< & <<V-5<<endl; cout<< [2] <<++V<< & <<U+2<<endl; Study Material Class XII (Comp.Sc.) :: 8::

9 Ans. [] 0 & 5 [2] 2 & 3 [3] & 6 [4] 22 & 4 Q6 Find the correct possible output from the option: #include<stdlib.h> #include<iostream.h> void main() Randomize(); Char Area[][0]= North, South, East, West ; int ToGo; for(int i=0;i<3;;i++) ToGo=random(2)+; Cout<<Area[ToGo]<< : ; Outputs: i. South : East : South : ii. North : South : East : iii. South : East : West: iv. South : East : East : Ans. (i),(iv). Q7 Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. #include<iostream.h> Void main() First=0, Second=20; Jumpto(First, Second); Jumpto(second); Void Jumpto(int N, int N2=20) N=N+N2; Cout<<N>>N2; Ans. #include<iostream.h> Void main() int First=0, Second=20; Jumpto(First, Second); Jumpto(Second); Void Jumpto(int N, int N2=20) N=N+N2; Cout<<N<<N2; Q8. Find the output of the following program : #include<iostream.h> void exec(int a, int &b); void main() int a=0; Study Material Class XII (Comp.Sc.) :: 9::

10 Ans: int b=20; cout<< a<< \t <<b; exec(a,b) cout<< a<< \t <<b; void exec(int a, int &b) a=a+00; b=b+50; cout<< a<< \t <<b; Study Material Class XII (Comp.Sc.) :: 0::

11 CHAPTER-2 : Object Oriented Programming Key Points: OOP: It means Object oriented programming which views a problem in terms of object rather than procedure. Object: An object is an identifiable entity with some characteristics and behavior. Class: A class is group of similar objects that share common properties and relationship. Data Abstraction: Abstraction refers to the act of representing essential features without including the background details or explanations. Encapsulation: The wrapping up of data members and member functions (that operate on the data) into a single unit (called class) in known as Encapsulation. Modularity: The act of dividing a complete program into different individual components (functions or modules) is called modularity. Inheritance: Inheritance is the capability of one class (sub class) of things to inherit characteristics or properties from another class (base class). Polymorphism: Polymorphism is the ability for a message or data to be processed in more than one form. 2 Mark Questions Questions and Answers Q What is programming paradigms? Give names of some popular programming paradigms? Ans:- It means an approach to programming or it defines the methodology of designing and implementing programs using building blocks of a programming language. Ex: Object Oriented Programming, Procedural Programming Q 2 What is the difference between Object Oriented Programming and Procedural Programming? Ans:- Object Oriented Programming Procedural Programming. It views a problem in term of objects.. It views a problem in terms of procedure 2. Features like data encapsulation, rather than objects. polymorphism, inheritance etc. are 2. Features like data encapsulation, present. polymorphism, inheritance etc. are not 3. It follows Bottom- Up approach in present. program design. 3. It follows Top- Down approach in program design. Q3 Define an object and a class with one example of each? Ans:- An object is an identifiable entity with some characteristics and behaviour. Eg. Orange is an object. Its characteristics are: it is spherical shaped and its colour is orange & its behaviour is: it is juicy and sweet- sour taste. A class is group of similar objects that share common properties and relationship. Eg. Parrot, sparrow and pigeon are objects that belongs to the class Bird. Q4 Define Data Abstraction Concept of OOP with one example? Ans:- Data Abstraction: Abstraction refers to the act of representing essential features without including the background details or explanations (i.e. Hiding of Data). Eg. While driving a car, you have to only know the essential features to drive a car such as gear & steering handling, use of clutch, accelerator and brakes etc. and not to know about how the engine working and internal wiring etc. Q5 Define Encapsulation Concept of OOP with one example? Study Material Class XII (Comp.Sc.) :: ::

12 Ans:- Encapsulation: The wrapping up of data members and member functions (that operate on the data) into a single unit (called class) in known as Encapsulation. Eg.The data members like rollno, name, marks & members functions like getdata ( ) and putdata ( ) are enclosed in a single unit called student class. Q6 Define Inheritance Concept of OOP with one example? Ans:- Inheritance: Inheritance is the capability of one class of things to inherit characteristics or properties from another class. The Class whose properties of data members are inherited, is called Base Class or Super Class and the class that inherits these properties, is called Derived Class or Sub Class. Eg. The class Human inherits certain properties such as ability to speak, breathe, eat etc from the class Mammal as these properties are not unique to humans & class Mammal again inherits some of its properties from another class Animal. Animal Mammal Human Q7 Define Polymorphism Concept of OOP with one example? Ans:- Polymorphism (poly +morph) means many forms i.e. ability for a message or data to be processed in more than one form. It is implemented as Overloading and Virtual functions in C++. Eg. Human is a subclass of Mammal. Similarly Dog, Cat are also subclasses of Mammal. If a message see through daylight is passed to all mammals, they all will behave alike. But if a message see through darkness is passed to all mammals, then humans and dogs will not be able to see where as cats will be able to see during night also. Q8 How Data Abstraction and Encapsulation are interrelated? Ans:- Data Abstraction focuses upon the observable behaviour of an object where as Encapsulation focuses upon the implementation that gives rise to this behaviour. So, we can say that Encapsulation is a way to implement Data Abstraction. Q9 What are the advantages of inheritance? Ans:- i) It ensures the closeness with the real- world models. ii) Reusability: One can derive a sub class from an existing base class and add new features in the sub class without modifying the inherited features. iii) Transitive nature: If a class C has been declared as a sub class of B which itself is a subclass of A then C must also inherits the properties of A. i.e. A B, B C Then A C. Q0 Give two advantages and disadvantages of OOP? Ans:- Advantages: Study Material Class XII (Comp.Sc.) :: 2::

13 i) Re-use of code. ii) Its code is near to real world models. Disadvantages: i) One needs to do proper planning, skills & design for OOP programming. ii) With OOP, classes tend to overly generalized. Q How does a class enforce data-hiding and abstraction? Ans:- A class binds data members and its associated functions together into a single unit thereby enforcing encapsulation. A class groups its members into three sections : private, protected and public. The private and protected members remain hidden from outside world. Thus through private and protected members, a class enforces data-hiding. The outside world is given only the essential and necessary information through public members, Rest of the things remain hidden, which is nothing but abstraction. Q2 Give an example in C++ to show polymorphism implementation in C++. Ans:- In C++ polymorphism is implemented through function overloading. A function name having several definitions that are differentiable by the number of types of their arguments is known function overloading. Eg. float area(float a) return a*a; float area (float a, float b) return a*b; Study Material Class XII (Comp.Sc.) :: 3::

14 CHAPTER-3 : Function Overloading Key Points: Function overloading is one of the most powerful features of C++ programming language. It forms the basis of polymorphism (compile-time polymorphism).function overloading is the practice of declaring the same function with different signatures. The same function name will be used with different number of parameters and parameters of different type. But overloading of functions with different return types are not allowed. For example let us assume an Add and Display function with different types of parameters. // Sample code for function overloading void AddAndDisplay(int x, int y) cout<<"integer result: "<<(x+y); void AddAndDisplay(double x, double y) cout<< " Double result: "<<(x+y); void AddAndDisplay(float x, float y) cout<< " float result: "<<(x+y); 2 Mark Questions Questions and Answers Q: What is function overloading? Give an example illustrating is use in C++ program? Ans: A function having several definitions that are differentiable by the number or types of their arguments is known as function overloading. Example Float area (float a) Return a * a; Float area (float a, float b) Return a*b; Q2 Ans: Q3 Ans: Q4 How would you compare default arguments and function overloading? In case of default arguments, default values can be provided in the function prototype itself and the function may be called even if an argument is missing(provided the default value for the missing argument is present in the prototype).but there is one limitation if you want to default a middle argument, then all the arguments on its right must also be defaulted. We can overload a function for all possible argument combination. It not only overcome the limitation of default arguments but also the compiler is saved from the trouble of testing the default value. How does function overloading implement polymorphism? Polymorphism is the ability for a message or data to be processed in more than one form. Function overloading is implement to function having (one name and)more than one distinct meanings. Answer the questions (i) and (ii) after going through the following class: Study Material Class XII (Comp.Sc.) :: 4::

15 class player int health; int age; public: player() health=6; age=8 //Constructor player(int s, int a) health =s; age = a ; //Constructor2 player( player &p) //Constructor3 ~player() cout<< Memory Deallocate ; //Destructor ; void main() player p(7,24);//statement player p3 = p; //Statement3 (i) When p3 object created specify which constructor invoked and why? (ii) Write complete definition for Constructor3? (iii) Which feature of object oriented programming is demonstrated using costructor,constructor2, constructor3 in the above class player? Ans: (i) Copy constructor is invoked when p3 object is created, because statement3 is assignment statement in which object p3 is initialize with object p. (ii) player( player &p) health = p.health age= p.age (iii) Function overloading (constructor overloading) Study Material Class XII (Comp.Sc.) :: 5::

16 CHAPTER- 4 : Classes and Objects Key Points: Class: A class is a way to bind the data describing an entity and its associated functions together. A class makes a data type that is used to create objects of its type. Objects: An instance of a class type is known as object. Method: It is a function that is part of a class. It is used to do things. Inline function: All functions defined inside a class and the functions whose definition starts with keyword inline are inline functions. Inline functions expand its code at the function call instead of jumping to the function code. Friend function: A friend function is non member function that is granted access to class private and protected members whereas, a friend class is a class whose member functions can access another class private and protected members. Access Specifiers: A class in C++ represents a group of data and associated functions divided into one or more of these parts: Public, Private and Protected. Nesting of member functions: When a member function is called by another member function, it is called nesting of member function. 2 Mark Questions Questions and Answers Q. What is class? What is its significance? Ans. A class is a way to bind the data describing an entity and its associated functions together. Class facilitates user defined data type or a type representing similar objects. Significance: The significance of classes lies in the fact that they can model real model entities effectively in the programming form. Real world entities not only posses characteristics but they also have an associated behavior. Q2. What is the significance of access labels in a class? Ans. A class provides three access labels namely Private, Protected and public. A member declared as private remains hidden form outside world and it can only be accessed by the member functions and friend functions of the class whereas protected members can be used by its child or derived class. A member declared as public is made available to the outside world. i.e. it can be accessed by any function, any expression in the program but only by using an object of the same class type. These access labels enforce data hiding and abstraction, OOP concepts. Q3. What do you mean data members and member functions in OOPS? Ans Data Members: Data members are the data type properties that describe the characteristics of a class. There may be zero or more data members of any type in a class. Member Functions: These are the set of operations that may be applied to objects of that class. There may be zero or more member functions for a class. They are referred to as the class interface. Q4. How is a member function differ from an ordinary function? Ans Member functions have full access privilege to both the public and private members of the class while, an ordinary functions have access only to the public members of the class. Member functions are defined within the class scope that is they are not visible outside the scope of class. Ordinary functions are also visible outside the scope of class. Q5. How is memory allocated to a class and its objects? Study Material Class XII (Comp.Sc.) :: 6::

17 Ans When a class is defined, memory is allocated for its member functions and they are stored in the memory. When an object is created, separate memory space is allocated for its data members. All objects work with the one copy of member function shared by all. Q6. What are the advantage and disadvantage of inline functions? Ans Advantage: The advantage of the inline function is that they run faster than the normal functions as there will be no function calling overheads. Disadvantage: The disadvantage of inline function is that it takes more memory space because the body of the function substituted in place of function call. 4 Mark Questions Q7. Suppose a class is defined as follows answer the following questions below: class animal Private: char name[5]; int legs; Public: Void input() cin>>name>>legs; Char *getname() return name; int num_of_legs() return legs; ; (i) How many data members does the class animal have? Ans: 2 (ii) How many methods does the class animal have? Ans: 3 (iii) Ans: (iii) Ans: How to declare an object of Class Animal? Animal mydog; Write statement to print the name and the number of legs of a dog object named mydog. Cout<<mydog.getname()<< has <<mydog.num_of_legs()<< legs <<endl; Q8. Define a class student for the following specifications. Private members are : rollno integer name array of characters of size 20 class_st array of characters of size 8 marks array of integers of size 5 percentage float Write a function to calculate that calculates overall percentage marks Public members are: Study Material Class XII (Comp.Sc.) :: 7::

18 Ans: Readmarks( ) reads marks and invokes the calculate function Displaymarks( ) prints all the members of the class. class student int rollno; char name[20]; char Class_st[8]; int marks[5]; float percentage; void calculate (); public: void readmarks(); void displaydata(); ; void student :: calculate() int tot=0; for(int i=0;i<5;i++) tot=tot + marks[i]; percentage=(tot/500)*00; void student :: readmarks() cout<< Enter the roll number: ; cin>>rollno; cout<< Enter name: ; gets(name); cout<< Enter class: ; gets(class_st); cout<< Enter marks in five subjects: ; for(int i=0;i<5;i++) cin>>marks[i]; calculate(); void student :: displaydata() cout<< Roll number is : <<rollno<<endl; cout<< Name is : <<name<<endl; cout<< class is : <<class_st<<endl; cout<< Marks in five subjects : ; for(int i=0;i<5;i++) cout<<marks[i]<<endl; cout<< Percentage is : <<percentage<< % ; Q9. Define a class serial in C++ with the following specifications: Private members of class serial Serialcode integer Title 20 character Duration float Noofepisodes integer Study Material Class XII (Comp.Sc.) :: 8::

19 Public member function of class serial A constructor to initialize duration as 30 and noofepisodes as 0. Newserial() function to accept values for Serialcode and Title. Otherentries () function to assign the values of Duration and Noofepisodes with the help of corresponding values passed as parameters to this function. Dispdata() function to display all the data members on the screen. Ans. class serial int serialcode; char Title[20]; float Duration; int Noofepisodes; Public: serial() Duration =30; Noofepisodes =0; void Newserial() cout<< \n Enter the code for serial : ; cin>>serialcode; cout<< \n Enter the title of a serial : ; gets(title); void otherentries(float dur, int noe) Duration=dur; Noofepisodes=noe; ; void Dispdata () cout<< \n Serial Code : <<serialcode; cout<< \n Title : <<Title; cout<< \n Duration : <<Duration; cout<< \n No. of Episodes : <<Noofepisodes; Q. 0. A class TRAVEL with the following descriptions: Private members are : Tcode, no_of_pass, no_of_buses integer (ranging from 0 to 55000) Place string Calculate function Calculates no_of_buses according to the following rules : Number of passengers Number of buses Less than 40 Equal to or more than 40 & less than 80 2 Equal to or more than 80 3 Public members are: A function INDETAILS( ) to input all information except no_of_buses and invoke calculate function A function OUTDETAILS( ) to display all the information. Ans. class Travel unsigned int tcode; unsigned int No_of_pass; Study Material Class XII (Comp.Sc.) :: 9::

20 unsigned int no_of_buses; char Place[20]; void calculate(); public: void INDETAILS( ); void OUTDETAILS( ); ; void Travel :: calculate( ) if (no_of_pass <40) no_of_buses=; else if (no_of_pass<80) no_of_buses=2; else no_of_buses=3; void Travel :: INDETAILS( ) cout<< Enter the Travel Code <<endl; cin>>tcode; cout<< Enter the no. of passengers <<endl; cin>>no_of_pass; cout<< Enter place <<endl; gets(place); calculate(); Void Travel :: OUTDETAILS( ) cout<< Tcode <<tcode; cout<< Number of passengers <<no_of_pass; cout<< Place <<place; cout<< Number of buses required are <<no_of_buses; Q. Define a class Library with following specifications: Private Members Book_no, Book_Name, price, no_of_copies, no_of_copies_issued Public Members - Constructor() to initializes all the data members with values i.e book information - issue_book() to issue book from library by checking its availability. - return_book() to return book to library and update the data of the library. - display() to display book information. Ans: class Library int book_no; char book_name[20]; int no_of_copies; int no_of_copies_issued; public: //constructor to initialized all data members Library(int b_no, char b_name[], int nc, int ni) Study Material Class XII (Comp.Sc.) :: 20::

21 book_no=b_no; strcpy(book_name,b_name); no_of_copies=nc; no_of_copies_issued=ni; // function of issue book from library void book_issue() If no_of_copies>= no_of_copies--; no_of_copies_issued++; else cout<< \n Book not available in library ; //function to return book to the library void return_book() no_of_copies++; no_of_copies_issued--; void display() cout<< \n Book Number : <<book_no; cout<< \n Book Name : <<book_name; cout<< \n No of copies : <<no_of_copies; cout<< \n Book issued : <<no_of_copies_issued; ; //end of class Study Material Class XII (Comp.Sc.) :: 2::

22 CHAPTER- 5 : Constructor & Destructor Key Points: Constructor: Constructor is a special member function of class whose task is to initialize data members of the object. It is automatically invoked when object of class is created. Its name is same as class name. The constructor functions have certain special characteristics:- Constructor functions are invoked automatically when the objects are created. Constructor has no return type even void. They can not be inherited. A destructor can not be static. Example: class student private: int Rn, Marks; Public: Student( ) // Constructor Rn=0; Marks=0; ; Types of constructor: Constructor has three types: Default Constructor: A constructor takes no arguments is called default constructor. It is automatically invoked when an object is created without providing any initial values. In case, the programmer has not defined a constructor in the class, the compiler will automatically generate default constructor. Parameterized Constructor: A constructor can accept arguments is known as parameterized constructor. Parameterized constructor is used to initialize the data member of object with different values. Copy Constructor: A copy Constructor is used to initialize an object from another object. Copy constructor always takes argument as a reference object. Destructor: As the name implies it is used to destroy the object that has been created by the Constructor. It is used to clean up the storage that is no longer required. Like a Constructor the destructor is a member function whose name is same as the class name but it is preceded by (~ )tilde sign. It is good practice to declare destructor in a program since it release memory space for future use. When controlled exited from main function then Destructor destroy the object obj, because it is no longer accessible. Characteristics of Destructor: It is automatically invoked when control exit from program or block and destroy the object. It never takes any arguments. It has no return type It can not be inherited. A destructor can not be static. Study Material Class XII (Comp.Sc.) :: 22::

23 Questions and Answers 2 Mark Questions Q. Answer the questions (i) and (ii) after going through the following class: class Exam int year; public: Exam (int y) year=y; //Constructor Exam (Exam & t); ///Constructor 2 ; Create an object, such that it invokes Constructor. Write complete definition for Constructor 2. Ans I. Exam obj (2009); II. Exam (Exam &t) year=t.year; Q2. Answer the questions (i) and (ii) after going through the following class: class Science char Topic [20]; int Weightage; public: Science ( ) //Function strcpy (Topic, Optics ); Weightage = 30; cout<< Topic Activated ; ~Science( ) //Function 2 cout<< Topic Deactivated ; ; (i) Name the specific features of class shown by Function and Function 2 in the above example. (ii) How would Function and Function 2 get executed? Ans: (i) Function : Constructor/ Default Constructor Function 2: Destructor (ii) Function is executed or invoked automatically when an object of class Science is created. Ex: Science s; Function 2 is invoked automatically when the scope of an object of class Science comes to an end. Q3. Answer the questions (i) and (ii) after going through the following class : class Computer char C_name[20]; char Config[00]; public: Computer(Computer &obj); // function Computer(); //function 2 Computer(char *n,char *C); // function3 ; Study Material Class XII (Comp.Sc.) :: 23::

24 i. Complete the definition of the function (ii) Name the specific feature of the OOPs shown in the above example Ans: (i) Computer (Computer &obj) strcpy (C_name, obj.c_name); strcpy(config, obj.config); (ii) Constructor overloading. Q4. Answer the questions (i) and (ii) after going through the following class: class Exam int Marks; char Subject[20]; public: Exam () //Function Marks = 0; strcpy (Subject, Computer ); Exam (char S []) //Function 2 Marks = 0; strcpy(subject,s); Exam (int M) //Function 3 Marks = M; strcpy (Subject, Computer ); Exam (char S[], int M) //Function 4 Marks = M; strcpy (Subject,S); ; (i) Write statements in C++ that would execute Function 3 and Function 4 of class Exam. (ii) Which feature of Object Oriented Programming is demonstrated using Function, Function 2, Function 3 and Function 4 in the above class Exam? Ans: (i) Exam obj (75); //To execute function 3: Exam obj2 ( computer, 85); // To execute function 3 (ii) Constructor Overloading Q5. Answer the question (i) and (ii) after going through the following class. class Bazar char Type[20]; char Product[20]; int Qty; float Price; Bazar( ) strcpy(type, Electronic ); strcpy(product, Calculation ); Qty = 0; Price = 225; Study Material Class XII (Comp.Sc.) :: 24::

25 ; public: void Disp( ) cout<<type<< - <<Product << : <<Qty <<price <<endl; void main( ) Bazar B; //statement B.Disp( ); //statement2 (i) Will statement initialize all the data member for object B with the values given in the Function? (Yes OR No). Justify your answer suggesting the correction(s) to be made in the above code. (ii)what shall be the possible output when the program gets executed? (Assuming, if required the suggested corrections are made in the program) Ans. (i) No, Since the default constructor Bazar( ) is declared inside private: section, it can not initialize the objects declared outside the class. Correction needed is the constructor Bazar( ) should be declared inside public: section. (ii) Electronic-calculator 225 Study Material Class XII (Comp.Sc.) :: 25::

26 CHAPTER- 6 : Inheritance Key Points: Inheritance is the capability of one class inherit properties from another class. There are two type of class one is base class and another is derived class. Derived class inherits from the base class. Inheritance may take place in many form. There are different type of inheritance:. Single inheritance:- one class inherited by one class. 2. Multiple inheritance : - One child inherited from two or more base classes 3. Multilevel inheritance: one class inherited by another class. Another class inherited by one another class. 4. Hierarchical inheritance:- two class inherit one class 5. Hybrid inheritance:- combines two or more forms of inheritance. Study Material Class XII (Comp.Sc.) :: 26::

27 Questions and Answers 4 Mark Questions Q. Answer the questions (i) to (iv) based on the following code : Class abc int a; char ch[0]; float cost; void ss(); public: int n; abc(); //Constructor void get_data(); // member function void put_data(); ; Class xyz : public abc int a[0]; char ch; void xx(); public: xyz(); void read_data(); void write_data(); ; //member function //Constructor //member function //member function (i) What is the size of object xyz in bytes (ii) Write name of all the member function accessible form the object of class xyz. (iii)which class constructor will be called first at the time of declaration of an object of class xyz. (iv) Name the data member(variable) which accessible from the object of class abc. Ans. (i) Calculate the size: =39 (ii) (iii) (iv) get_data() and put_data from abc class read_data() and write_data from xyz class. Abc() then xyz() n Study Material Class XII (Comp.Sc.) :: 27::

28 Q2. Answer the questions (i) to (iv) based on the following code : class Employee int id; protected : char name[20]; char doj[20]; public : Employee(); ~Employee(); void get(); void show(); ; class Daily_wager : protected Employee int wphour; protected : int nofhworked; public : void getd(); void showd(); ; class Payment : private Daily_wager char date[0]; protected : int amount; public : Payment(); ~Payment(); void show(); ; (i) Name the type of Inheritance depicted in the above example. (ii) (iii) (iv) (v) Name the member functions, which are accessible by the objects of class Payment. From the following, Identify the member function(s) that can be called directly from the object of class Daily_wager class show(), getd(), get() Find the memory size of object of class Daily_wager. Is the constructors of class Employee will copied in class Payment? Due to inheritance. Ans: (i) Multilevel inheritance (ii) void show() (iii) getd() (iv) 46 Note: Employee= =42 daily_wager=2+2 =04 total =46 (v) not copied Q3. Consider the following code and answer the questions: class typea int x; protected: Study Material Class XII (Comp.Sc.) :: 28::

29 int k; public: typea(int m); void showtypea(); ; class typeb : public typea float p,q; protected: int m; void intitypeb(); public: typeb(float a, float b); void showtypeb(); ; class typec : private typeb int u,v; public: typec(int a, int b); void showtypec(); ; (i) How much byte does an object belonging to class typec require? (ii) Name the data member(s), which are accessible from the object(s) of class typec. (iii) Name the data members, which can be accessed from the member functions of class typec? (iv) Is data member k accessible to objects of class typeb? Ans:- (i) 8 Class a= 2+2 =4 Class b=4+4+2 =0 Class c= 2+2 =4 Total =8 (ii) None (iii) m,k,u,v (iv) No Q4. Answer the question (i) to (iv) based on the following code: Class Medicines char Category[0]; char Dateofmanufacture[0]; char Company[20]; public: Medicines(); void entermedicinedetails(); void showmedicinedetails(); ; class Capsules : public Medicines protected: char capsulename[30]; char volumelabel[20]; public: float Price; Capsules(); Study Material Class XII (Comp.Sc.) :: 29::

30 void entercapsuledetails(); void showcapsuledetails(); ; class Antibiotics : public Capsules int Dosageunits; char sideeffects[20]; int Usewithindays; public: Antibiotics(); void enterdetails(); void showdetails(); ; (i) How many bytes will be required by an object of class Medicines and an object of class Antibiotics respectively? (ii) Write names of all the member functions accessible from the object of class Antibiotics. (iii) Write names of all the members accessible from member functions of class Capsules. (iv) Write names of all the data members which are accessible from objects of class Antibiotics. Ans: (i) medicines=40 and antibiotics=8 Note: Medicines = =40 Capsules = =54 Antibiotics = =24 Total= 8 (ii)entermedicinedetails(), showmedicinedetails(), entercapsuledetails(), showcapsuledetails(), void enterdetails(); showdetails(); (iii) entermedicinedetails(),showmedicinedetails(), entercapsuledetails(), showcapsuledetails(), price, capsulename, volumelabel (iv) price Q5. Answer the following questions (i) to (iv) based on the following code : class DRUG char catg[0]; protected: char DOF[0], comp[20]; public: DRUG( ); void endrug( ); void showdrug( ); ; class TABLET : public DRUG protected: char tname[30],volabel[20]; public: TABLET( ); void entab( ); void showtab( ); ; class PAINKILLER : public TABLET int dose, usedays; char seffect[20]; public : Study Material Class XII (Comp.Sc.) :: 30::

31 (i) (ii) (iii) (iv) void entpain( ); void showpain( ); ; How many bytes will be required by an object of TABLET? Write names of all the data members accessible from member functions of class TABLET? Write names off all members functions accessible from object of class PAINKILLER. Write names of all data members accessible from member functions of class PAINKILLER. Ans: i) 90 drug=0+0+20=40 Tablet=30+20 =50 Total =90 ii) tname, volabel, DOF, Comp iii) endrug(), showdrug(),entab(),showtab(), entpain(), showpain() iv) does, usedays, tname, valabel, seffect, catg, comp, DOF Study Material Class XII (Comp.Sc.) :: 3::

32 CHAPTER-7 : Arrays Key Points: An array is a finite, ordered set of homogeneous elements that stored in contiguous memory locations, elements can be accessed by the index. There are two type of array. Single Dimension Array (-D) Two Dimension Array (2-D) Single Dimension Array:- One dimensional array is simply a named group of finite number of similar data elements under one index. e.g elements Index Two Dimension Array:- Two dimensional array is simply a named group of finite number of similar data elements under two index. e.g. A[0,0] A[0,] A[0,2] A[0,3] A[,0] A[,] A[,2] A[,3] A[2,0] A[2,] A[2,2] A[2,3] Address Calculation in Arrays- We may compute the address of any subscript of array in memory. Since, array is stored in contiguous memory locations. The facts like base address and data type of array elements should be consider in address calculation.. Address Computation of Single dimensional array- Since the elements of one dimensional array are stored in the memory location by sequential allocation techniques, the address of I th element of the array can be obtained, if we know- (a) The Base address (the address of first element) of the array and denoted by B. (b) The size of the element in the array denoted by S and LB is Lower bound. In C++ language LB is 0. Address of I th Element = B+(I LB) * s 2. Address Computation of Two -dimensional array: Since elements of the two-dimensional array can be stored in the computer memory in contiguous manner in row wise order. In general, the address of an array element may be computed as- Address of an element = Base address +(no of elements before this element) * size Let B is base address, S is size of each element, M and N is the number of row and column respectively. We obtain the formula as follows- Address of a[i,j]=b+s [(i*n)+j] Operations on Array Traversing:- Accessing (or Printing ) the elements of array. Insertion: Insertion of an element in the array at specified position or at end. Deletion: Removing an element from an array from specific location. Searching: Finding a given value in the array. Sorting: Arranging elements of the array in Ascending or descending order. Study Material Class XII (Comp.Sc.) :: 32::

33 Q. write a program to show a linear search. Answer:- #include<iostream.h> #include<conio.h> int search(int A[], int size,int N) clrscr(); int i; for(i=0;i<size;i++) if(a[i]==n) return(i); return(-); Q.2 Suppose A,B,C are array of integer of size M,N and M+N respectively. The numbers in array A appears in ascending order while the numbers in array B is in descending order. Write a user defined function in c++ to produce III rd array.(by merging solution) Answer:- #include<iostream.h> #include<conio.h> void merge(int A[],int M,int B[],int N,int C[]) int a,b,c; for(a=0,b=n-,c=0;a<m&&b>0;) if(a[a]<=b[b]) C[c]=A[a]; c++; a++; else C[c]=B[b]; c++; b--; if(a<m) while(a<=m) c[c++]=a[a++]; else while(b>=0) c[c++]=b[b--]; Q.3 Suppose a one dimensional array ARR containing integers arranged in ascending order. Write a user defined function in C++ to search for one integer from ARR with the help of binary search method. The function should return an integer 0 to show absence of the number & the integer to show the presence of the number in the array. The function should have three parameters as () an array ARR (2) the number DATA to be searched (3) number of element N. Answer:- #include<iostream.h> #include<conio.h> Study Material Class XII (Comp.Sc.) :: 33::

34 int Bsearch(int ARR[],int n, int Data) int beg,last,mid; beg=0;last=n-; while(beg<=last) mid = (beg+last)/2; if(data = =ARR[mid]) return ; else if (Data>Arr[mid]) beg = mid+; else last = mid-; return 0; Q.4 write a function to sort an array using selection sort method. Answer:- void insert(int a[], int size) int i, j, n, t; clrscr(); for (i=0;i<n-;i++) for (j=i+;j<n;j++) if (a[i]> a[j]) t = a[i]; a[i]=a[j]; a[j]=t; Q.5 Write a function to implement bubble sort to sort an array. Answer:- void bubble(int a[], int size) int i, j, n, temp; clrscr(); for (i=0;i<n-;i++) for (j=0;j<n--i; j++) If( a[j]>a[j+]) temp = a[j]; a[j] = a[j+]; a[j+] = temp; Q6. An array MAT [20][0] is stored in the memory along the row with each element occupying 4 bytes of memory. Find out the base address & the address of elements MAT [0][5], if the location of MAT [3][7] is stored at address 000. Answer:- Let Base address is B No. of column (n) = 0 Element size (W) = 4 Study Material Class XII (Comp.Sc.) :: 34::

35 Lowest Row & Column indices major order is : address of I th, J th element of array in row Address of MAT [I][J] = B+uI- +J- MAT [3][7] = = B+4(0(3-6)+(7-0)) 000 = B+4(30+7) 000 = B+4(37) 000 = B+48 B = B = 852 MAT [0][5] = 852+4(0(0-0)+(5-0)) = 852+4(00+5) = 852+4(05) = = 272 Q7. Write a function in C++ which accepts an integer array & its size as arguments/parameters & assign the elements into a two dimensional array of integers in the following format:- If the array is,2,3,4,5,6 then resultant 2D array = And if the array is, 2, 3 then resultant 2D array = Answer:- void func(int arr[], int size) int a2[20][20]; int i,j; for (i=0;i<size;i++) for (j=0;j<size;j++) if(i>=j) a2[i][j] = arr[j]; else a2[i][j] = 0; cout<< a2[i][j]<< ; cout<<endl; Q8: Write a function in C++ which accepts an integer array & its size as arguments/parameters and assign the elements into two dimensional arrays of integers in the following format If the array is, 2, 3,4,5,6 then resultant 2D array = Study Material Class XII (Comp.Sc.) :: 35::

36 And if the array is, 2, 3 then resultant 2D array = Answer:- void func(int arr[], int size) int a2[20][20]; int i,j; for (i=0;i<size;i++) for (j=0;j<size;j++) if ((size-i)<j) a2[i][j] = 0; else a2[i][j] = arr[j]; cout<< a2[i][j]<< ; cout<<endl; Q.9: An array MAT [30][0] is stored in the memory column wise with each element occupying & bytes of memory. Find out the base address & the address of elements MAT [20][5], if the location of MAT [5][7]is stored at the address 000. Answer:- Base address B No. of rows (m) = 30 Element size (W) = 8 Lowest Row & Column indices column major order is : Address of MAT [I][J] = B+W(m(J- )+ (I- )) MAT [5][7] = = B+8(30(7-0)+(5-0)) 000 = B+8(20+5) 000 = B+8(25) 000 = B+720 B = B = -720 Hence Base address is Now address of MAT [20][5] is computed as: MAT [20][5] = (30(5-0)+(20-0)) = (50+20) = (70) = = 640 Hence address of MAT [20][5] is 640. address of I th, J th element of array in Study Material Class XII (Comp.Sc.) :: 36::

37 CHAPTER- 8 : Data Base Concept & SQL Key Points: Database is a collection of different kinds of data which are connecting with some relation. In different way, it is a computer based record keeping system. The collection of data referred to as a database. A database management system is answer to all these problems as it provides a centralized control of the data. Advantages of Database:. It reduce the data redundancy 2. Control data inconsistency 3. Facilitate sharing of data 4. Databases enforce standards 5. Ensure data security 6. Integrity can be maintained Data: It is row facts, figures, characters, etc with which we have to start. Information: The processed data or meaningful data is known as information. Database: An organized collection of relational data is called as database. DBMS: It is a Database Management System. It is a system used for create database, store the data, secure it and fetch data whenever required. MS Access, Oracle are the example of DBMS. Data Models : The external level and conceptual level user certain data structures to help utilize the database efficiently. There are three data models that are used for database management system are:. Relational Data Model 2. Hierarchical Data Model 3. Network Data Model Commonly used Terms related to Data Base: Tuple : The rows of tables are generally referred to as Tuples. Attributes : The columns of tables are generally referred to as attributes. Degree : The number of attributes in a relation determine the degree of a relation. A Table having five columns is said to be a relation of degree five. Cardinality : The number of tuples (rows) in relation (table) is called the Cardinality of the relation. Primary Key : It is a set of one or more attributes that can uniquely identify tuples within the relation. For e.g. EmpNo. is the primary key for the table Employee. Candidate Key : All attributes combinations inside a relation that can serve as primary key are Candidate keys as they are having the candidature to work as the Primary Key. Alternate Key : A candidate key that is not the primary key but can be used in place of primary key is called an alternate key. SQL Structured Query Language: SQL is the set of commands that is recognized by nearly all the RDBMS. It is a language that enables us to create and operate on relational databases, which are sets of related information stored in tables. Processing Capabilities of SQL: Study Material Class XII (Comp.Sc.) :: 37::

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOME WORK XII COMPUTER SCIENCE ARRAY AND STRUCTURES

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOME WORK XII COMPUTER SCIENCE ARRAY AND STRUCTURES KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOME WORK- 2018-19 XII COMPUTER SCIENCE ARRAY AND STRUCTURES 1. Write a function which will take a string and returns the word count. Each word is separated

More information

Downloaded from

Downloaded from Unit I Chapter -1 PROGRAMMING IN C++ Review: C++ covered in C++ Q1. What are the limitations of Procedural Programming? Ans. Limitation of Procedural Programming Paradigm 1. Emphasis on algorithm rather

More information

Sri Vidya College of Engineering & Technology

Sri Vidya College of Engineering & Technology UNIT I INTRODUCTION TO OOP AND FUNDAMENTALS OF JAVA 1. Define OOP. Part A Object-Oriented Programming (OOP) is a methodology or paradigm to design a program using classes and objects. It simplifies the

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION Roll Number SET 1 INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION COMPUTER SCIENCE CLASS: XII Sub. Code: 08 Time Allotted: Hr 09.05.018 Max. Marks: 70 GENERAL INSTRUCTIONS: 1. All questions are compulsory..

More information

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science HOLIDAYS HOMEWORK 2017-18 CLASS : XII Subject : Computer Science Note : Attempt the following questions in a separate register and make yourself prepared to conquer the world. Chapter- 1 : C++ Revision

More information

Object Oriented Pragramming (22316)

Object Oriented Pragramming (22316) Chapter 1 Principles of Object Oriented Programming (14 Marks) Q1. Give Characteristics of object oriented programming? Or Give features of object oriented programming? Ans: 1. Emphasis (focus) is on data

More information

COIMBATORE EDUCATIONAL DISTRICT

COIMBATORE EDUCATIONAL DISTRICT COIMBATORE EDUCATIONAL DISTRICT REVISION EXAMINATION JANUARY 2015 STD-12 COMPUTER SCIENCE ANSEWR KEY PART-I Choose the Correct Answer QNo Answer QNo Answer 1 B Absolute Cell Addressing 39 C Void 2 D

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

Darshan Institute of Engineering & Technology for Diploma Studies

Darshan Institute of Engineering & Technology for Diploma Studies 1. Explain Call by Value vs. Call by Reference Or Write a program to interchange (swap) value of two variables. Call By Value In call by value pass value, when we call the function. And copy this value

More information

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions. Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Reaccredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated 'A'

More information

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PROGRAMMING Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PARADIGM Object 2 Object 1 Data Data Function Function Object 3 Data Function 2 WHAT IS A MODEL? A model is an abstraction

More information

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++ No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

Computer Science XII Important Concepts for CBSE Examination Questions

Computer Science XII Important Concepts for CBSE Examination Questions Computer Science XII Important Concepts for CBSE Examination Questions LEARN FOLLOWIING GIVEN CONCEPS 1. Encapsulation: Wraps up data and functions under single unit through class. Create a class as example.

More information

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083) KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION CLASS XII COMMON PREBOARD EXAMINATION 05-06 COMPUTER SCIENCE (08) Time: hours Max. Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming

More information

CHAPTER 4 FUNCTIONS. 4.1 Introduction

CHAPTER 4 FUNCTIONS. 4.1 Introduction CHAPTER 4 FUNCTIONS 4.1 Introduction Functions are the building blocks of C++ programs. Functions are also the executable segments in a program. The starting point for the execution of a program is main

More information

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II SUB : COMPUTER SCIENCE CLASS : XII TIME : 90 MINS M.M: 40 1.a. Differentiate between default & parameterized constructor with suitable example.

More information

AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI ASSIGNMENT CLASS XI Session Chapter 1: Computer Overview

AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI ASSIGNMENT CLASS XI Session Chapter 1: Computer Overview AHLCON PUBLIC SCHOOL, MAYUR VIHAR I, DELHI - 110091 ASSIGNMENT CLASS XI Session 2018-19 Chapter 1: Computer Overview 1. 2. 3. What is the difference between data and information. What is CPU. Explain the

More information

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year Object Oriented Programming Assistant Lecture Omar Al Khayat 2 nd Year Syllabus Overview of C++ Program Principles of object oriented programming including classes Introduction to Object-Oriented Paradigm:Structures

More information

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming

More information

CS201 Some Important Definitions

CS201 Some Important Definitions CS201 Some Important Definitions For Viva Preparation 1. What is a program? A program is a precise sequence of steps to solve a particular problem. 2. What is a class? We write a C++ program using data

More information

1. Write two major differences between Object-oriented programming and procedural programming?

1. Write two major differences between Object-oriented programming and procedural programming? 1. Write two major differences between Object-oriented programming and procedural programming? A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do:

More information

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples: Unit IV Pointers and Polymorphism in C++ Concepts of Pointer: A pointer is a variable that holds a memory address of another variable where a value lives. A pointer is declared using the * operator before

More information

Data Structures using OOP C++ Lecture 3

Data Structures using OOP C++ Lecture 3 References: th 1. E Balagurusamy, Object Oriented Programming with C++, 4 edition, McGraw-Hill 2008. 2. Robert L. Kruse and Alexander J. Ryba, Data Structures and Program Design in C++, Prentice-Hall 2000.

More information

Basics of Object Oriented Programming. Visit for more.

Basics of Object Oriented Programming. Visit   for more. Chapter 4: Basics of Object Oriented Programming Informatics Practices Class XII (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra,

More information

Department of Computer science and Engineering Sub. Name: Object oriented programming and data structures Sub. Code: EC6301 Sem/Class: III/II-ECE Staff name: M.Kavipriya Two Mark Questions UNIT-1 1. List

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 Code: DC-05 Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 NOTE: There are 11 Questions in all. Question 1 is compulsory and carries 16 marks. Answer to Q. 1. must be written in the space

More information

SRI SARASWATHI MATRIC HR SEC SCHOOL PANAPAKKAM +2 IMPORTANT 2 MARK AND 5 MARK QUESTIONS COMPUTER SCIENCE VOLUME I 2 MARKS

SRI SARASWATHI MATRIC HR SEC SCHOOL PANAPAKKAM +2 IMPORTANT 2 MARK AND 5 MARK QUESTIONS COMPUTER SCIENCE VOLUME I 2 MARKS SRI SARASWATHI MATRIC HR SEC SCHOOL PANAPAKKAM +2 IMPORTANT 2 MARK AND 5 MARK QUESTIONS COMPUTER SCIENCE VOLUME I 2 MARKS 1. How to work with multiple documents in StarOffice Writer? 2. What is meant by

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E. - Electrical and Electronics Engineering IV SEMESTER CS6456 - OBJECT ORIENTED

More information

OOP THROUGH C++(R16) int *x; float *f; char *c;

OOP THROUGH C++(R16) int *x; float *f; char *c; What is pointer and how to declare it? Write the features of pointers? A pointer is a memory variable that stores the address of another variable. Pointer can have any name that is legal for other variables,

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Classes Chapter 4 Classes and Objects Data Hiding and Encapsulation Function in a Class Using Objects Static Class members Classes Class represents a group of Similar objects A class is a way to bind the

More information

POINTERS - Pointer is a variable that holds a memory address of another variable of same type. - It supports dynamic allocation routines. - It can improve the efficiency of certain routines. C++ Memory

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING 1. Programming Paradigms OBJECT ORIENTED PROGRAMMING A programming methodology defines the methodology of designing and implementing programs using the key features and other building blocks (such as key

More information

(a) Differentiate between a call by value and call by reference method.

(a) Differentiate between a call by value and call by reference method. ATOMIC ENERGY CENTRAL SCHOOL NO- RAWATBHATA Half Yearly Examination 05 Model Paper Class XII Subject Computer Science Time Allowed: hours Maximum Marks: 70 Note. (i) All questions are compulsory. (ii)

More information

CS304 Object Oriented Programming Final Term

CS304 Object Oriented Programming Final Term 1. Which of the following is the way to extract common behaviour and attributes from the given classes and make a separate class of those common behaviours and attributes? Generalization (pg 29) Sub-typing

More information

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1 Chapter -1 1. Object Oriented programming is a way of problem solving by combining data and operation 2.The group of data and operation are termed as object. 3.An object is a group of related function

More information

An Object Oriented Programming with C

An Object Oriented Programming with C An Object Oriented Programming with C By Tanmay Kasbe Dr. Ravi Singh Pippal IDEA PUBLISHING WWW.ideapublishing.in i Publishing-in-support-of, IDEA PUBLISHING Block- 9b, Transit Flats, Hudco Place Extension

More information

Padasalai.Net s Model Question Paper

Padasalai.Net s Model Question Paper Padasalai.Net s Model Question Paper STD: XII VOLUME - 2 MARKS: 150 SUB: COMPUTER SCIENCE TIME: 3 HRS PART I Choose the correct answer: 75 X 1 = 75 1. Which of the following is an object oriented programming

More information

Sample Paper Class XI Subject Computer Sience UNIT TEST II

Sample Paper Class XI Subject Computer Sience UNIT TEST II Sample Paper Class XI Subject Computer Sience UNIT TEST II (General OOP concept, Getting Started With C++, Data Handling and Programming Paradigm) TIME: 1.30 Hrs Max Marks: 40 ALL QUESTIONS ARE COMPULSURY.

More information

PROGRAMMING IN C++ COURSE CONTENT

PROGRAMMING IN C++ COURSE CONTENT PROGRAMMING IN C++ 1 COURSE CONTENT UNIT I PRINCIPLES OF OBJECT ORIENTED PROGRAMMING 2 1.1 Procedure oriented Programming 1.2 Object oriented programming paradigm 1.3 Basic concepts of Object Oriented

More information

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR 603203 DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS QUESTION BANK (2017-2018) Course / Branch : M.Sc CST Semester / Year : EVEN / II Subject Name

More information

PART - I 75 x 1 = The building blocks of C++ program are (a) functions (b) classes (c) statements (d) operations

PART - I 75 x 1 = The building blocks of C++ program are (a) functions (b) classes (c) statements (d) operations OCTOBER 2007 COMPUTER SCIENCE Choose the best answer: PART - I 75 x 1 = 75 1. Which of the following functions will be executed first automatically, when a C++ Program is (a) void (b) Main (c) Recursive

More information

JB ACADEMY HALF-YEARLY EXAMINATION 2016 CLASS XII COMPUTER SCIENCE. Time: 3:00 Hrs. M.M.: 70

JB ACADEMY HALF-YEARLY EXAMINATION 2016 CLASS XII COMPUTER SCIENCE. Time: 3:00 Hrs. M.M.: 70 JB ACADEMY HALF-YEARLY EXAMINATION 2016 CLASS XII COMPUTER SCIENCE Time: 3:00 Hrs. M.M.: 70 Q.1 (a) Explain in brief the purpose of function prototype with the help of a suitable example. (b) Identify

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

COMMON QUARTERLY EXAMINATION SEPTEMBER 2018

COMMON QUARTERLY EXAMINATION SEPTEMBER 2018 i.ne COMMON QUARTERLY EXAMINATION SEPTEMBER 2018 1. a) 12 2. a) Delete 3. b) Insert column 4. d) Ruler 5. a) F2 6. b) Auto fill 7. c) Label 8. c) Master page 9. b) Navigator 10. d) Abstraction 11. d) Void

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class Chapter 6 Inheritance Extending a Class Introduction; Need for Inheritance; Different form of Inheritance; Derived and Base Classes; Inheritance and Access control; Multiple Inheritance Revisited; Multilevel

More information

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS Contents Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS 1.1. INTRODUCTION TO COMPUTERS... 1 1.2. HISTORY OF C & C++... 3 1.3. DESIGN, DEVELOPMENT AND EXECUTION OF A PROGRAM... 3 1.4 TESTING OF PROGRAMS...

More information

STRUCTURING OF PROGRAM

STRUCTURING OF PROGRAM Unit III MULTIPLE CHOICE QUESTIONS 1. Which of the following is the functionality of Data Abstraction? (a) Reduce Complexity (c) Parallelism Unit III 3.1 (b) Binds together code and data (d) None of the

More information

C++ 8. Constructors and Destructors

C++ 8. Constructors and Destructors 8. Constructors and Destructors C++ 1. When an instance of a class comes into scope, the function that executed is. a) Destructors b) Constructors c) Inline d) Friend 2. When a class object goes out of

More information

DELHI PUBLIC SCHOOL TAPI

DELHI PUBLIC SCHOOL TAPI Loops Chapter-1 There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed

More information

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION 2017 2018 Class: XII Subject : Computer Science Assignment No. 3 1. a) What is this pointer? Explain with example. b) Name the header file

More information

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011 Lectures 1-22 Moaaz Siddiq Asad Ali Latest Mcqs MIDTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please

More information

INTERNATIONAL INDIAN SCHOOL, RIYADH. Ch 1 C++ Revision tour

INTERNATIONAL INDIAN SCHOOL, RIYADH. Ch 1 C++ Revision tour Grade- XII Computer Science Worksheet Ch 1 C++ Revision tour 1) Explain in brief the purpose of function prototype with the help of a suitable example. 2) What is the benefit of using default parameter/argument

More information

Downloaded from

Downloaded from Unit-II Data Structure Arrays, Stacks, Queues And Linked List Chapter: 06 In Computer Science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.

More information

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Question No: 1 ( Marks: 2 ) Write a declaration statement for an array of 10

More information

- HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM

- HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM www.padasalai.net - HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM 1 A 26 D 51 C 2 C 27 D 52 D 3 C 28 C 53 B 4 A 29 B 54 D 5 B 30 B 55 B 6 A 31 C 56 A 7 B 32 C 57 D 8 C 33 B 58 C

More information

CHAPTER 5 GENERAL OOP CONCEPTS

CHAPTER 5 GENERAL OOP CONCEPTS CHAPTER 5 GENERAL OOP CONCEPTS EVOLUTION OF SOFTWARE A PROGRAMMING LANGUAGE SHOULD SERVE 2 RELATED PURPOSES : 1. It should provide a vehicle for programmer to specify actions to be executed. 2. It should

More information

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION. REVISION Examination 2013 COMPUTER SCIENCE (083) CLASS XII

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION. REVISION Examination 2013 COMPUTER SCIENCE (083) CLASS XII KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION REVISION Examination 01 COMPUTER SCIENCE (08) CLASS XII Time Allowed: Hours Maximum Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming

More information

CS201 Latest Solved MCQs

CS201 Latest Solved MCQs Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

Chapter4: Data Structures. Data: It is a collection of raw facts that has implicit meaning.

Chapter4: Data Structures. Data: It is a collection of raw facts that has implicit meaning. Chapter4: s Data: It is a collection of raw facts that has implicit meaning. Data may be single valued like ID, or multi valued like address. Information: It is the processed data having explicit meaning.

More information

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C Practical -1 Babaria Institute of Technology LEARN CONCEPTS OF OOP 1. Explain Object Oriented Paradigm with figure. 2. Explain basic Concepts of OOP with example a. Class b. Object c. Data Encapsulation

More information

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE a) Mention any 4 characteristic of the object car. Ans name, colour, model number, engine state, power b) What

More information

JAVA GUI PROGRAMMING REVISION TOUR III

JAVA GUI PROGRAMMING REVISION TOUR III 1. In java, methods reside in. (a) Function (b) Library (c) Classes (d) Object JAVA GUI PROGRAMMING REVISION TOUR III 2. The number and type of arguments of a method are known as. (a) Parameter list (b)

More information

CS201- Introduction to Programming Current Quizzes

CS201- Introduction to Programming Current Quizzes CS201- Introduction to Programming Current Quizzes Q.1 char name [] = Hello World ; In the above statement, a memory of characters will be allocated 13 11 12 (Ans) Q.2 A function is a block of statements

More information

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size];

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size]; Arrays An array is a collection of two or more adjacent memory cells, called array elements. Array is derived data type that is used to represent collection of data items. C Array is a collection of data

More information

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018) Lesson Plan Name of the Faculty Discipline Semester :Mrs. Reena Rani : Computer Engineering : IV Subject: OBJECT ORIENTED PROGRAMMING USING C++ Lesson Plan Duration :15 weeks (From January, 2018 to April,2018)

More information

COMPUTER SCIENCE (083)

COMPUTER SCIENCE (083) Roll No. Code : 112012-083 Please check that this question paper contains 7 questions and 8 printed pages. CLASS-XI COMPUTER SCIENCE (083) Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions

More information

C++ (Non for C Programmer) (BT307) 40 Hours

C++ (Non for C Programmer) (BT307) 40 Hours C++ (Non for C Programmer) (BT307) 40 Hours Overview C++ is undoubtedly one of the most widely used programming language for implementing object-oriented systems. The C++ language is based on the popular

More information

CS201 Spring2009 Solved Sunday, 09 May 2010 14:57 MIDTERM EXAMINATION Spring 2009 CS201- Introduction to Programming Question No: 1 ( Marks: 1 ) - Please choose one The function of cin is To display message

More information

KendriyaVidyalayaSangathan Kolkata Region

KendriyaVidyalayaSangathan Kolkata Region KendriyaVidyalayaSangathan Kolkata Region Third Pre-Board Examination : 204-5 Please check that this question paper contains 7 questions. Please write down the Serial Number of the question before attempting

More information

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and #include The Use of printf() and scanf() The Use of printf()

More information

SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL. TWO MARKS

SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL. TWO MARKS SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL. COMPUTER SCIENCE - STAR OFFICE TWO MARKS LESSON I 1. What is meant by text editing? 2. How to work with multiple documents in StarOffice Writer? 3. What is the

More information

Interview Questions of C++

Interview Questions of C++ Interview Questions of C++ Q-1 What is the full form of OOPS? Ans: Object Oriented Programming System. Q-2 What is a class? Ans: Class is a blue print which reflects the entities attributes and actions.

More information

XII CS(EM) Minimum Question List N.KANNAN M.Sc., B.Ed COMPUTER SCIENCE IMPORTANT QUESTION (TWO MARKS) CHAPTER 1 TO 5 ( STAR OFFICE WRITER)

XII CS(EM) Minimum Question List N.KANNAN M.Sc., B.Ed COMPUTER SCIENCE IMPORTANT QUESTION (TWO MARKS) CHAPTER 1 TO 5 ( STAR OFFICE WRITER) COMPUTER SCIENCE IMPORTANT QUESTION (TWO MARKS) CHAPTER 1 TO 5 ( STAR OFFICE WRITER) 1. Selecting text with keyboard 2. Differ copying and moving 3. Text Editing 4. Creating a bulleted list 5. Creating

More information

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Quiz Start Time: 09:34 PM Time Left 82 sec(s) Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

UNIT-I Fundamental Notations

UNIT-I Fundamental Notations UNIT-I Fundamental Notations Introduction to Data Structure We know that data are simply values or set of values and information is the processed data. And actually the concept of data structure is much

More information

SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE. Sample paper-i. Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.:

SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE. Sample paper-i. Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.: SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE Sample paper-i Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.: General Instruction 1. Please check that this question paper contains 7 questions. 2.

More information

ARRAY FUNCTIONS (1D ARRAY)

ARRAY FUNCTIONS (1D ARRAY) ARRAY FUNCTIONS (1D ARRAY) EACH QUESTIONS CARRY 2 OR 3 MARKS Q.1 Write a function void ChangeOver(int P[ ], int N) in C++, which re-positions all the elements of the array by shifting each of them to the

More information

Sample Paper 2013 SUB: COMPUTER SCIENCE GRADE XII TIME: 3 Hrs Marks: 70

Sample Paper 2013 SUB: COMPUTER SCIENCE GRADE XII TIME: 3 Hrs Marks: 70 Sample Paper 2013 SUB: COMPUTER SCIENCE GRADE XII TIME: 3 Hrs Marks: 70 INSTRUCTIONS: All the questions are compulsory. i. Presentation of answers should be neat and to the point. iii. Write down the serial

More information

CS6202 - PROGRAMMING & DATA STRUCTURES UNIT I Part - A 1. W hat are Keywords? Keywords are certain reserved words that have standard and pre-defined meaning in C. These keywords can be used only for their

More information

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. 9 Self-Test Exercises p. 11 History Note p. 12 Programming and

More information

Introduction to Computer Science Midterm 3 Fall, Points

Introduction to Computer Science Midterm 3 Fall, Points Introduction to Computer Science Fall, 2001 100 Points Notes 1. Tear off this sheet and use it to keep your answers covered at all times. 2. Turn the exam over and write your name next to the staple. Do

More information

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE Sample Paper - 2013 Class XII SUBJECT : COMPUTER SCIENCE FIRST SEMESTER EXAMINATION Instructions: (i) All questions are compulsory. (ii) (ii) Programming Language : C++ 1. (a) Name the header files that

More information

BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI. Unit Wise Marks

BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI. Unit Wise Marks BLUE PRINT SUBJECT: - COMPUTER SCIENCE(083) CLASS-XI Unit Wise Marks Unit No. Unit Name Marks 1. COMPUTER FUNDAMENTAL 10 2. PROGRAMMING METHODOLOGY 12 3. INTRODUCTION TO C++ 1. INTRODUCTION TO C++ 3 TOTAL

More information

INHERITANCE: EXTENDING CLASSES

INHERITANCE: EXTENDING CLASSES INHERITANCE: EXTENDING CLASSES INTRODUCTION TO CODE REUSE In Object Oriented Programming, code reuse is a central feature. In fact, we can reuse the code written in a class in another class by either of

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

HOLIDAY HOMEWORK ASSIGNMENT-5 Q1. What will be the output of the following program segment Class Num { int x; float y; public: void init( ) { x = y =

HOLIDAY HOMEWORK ASSIGNMENT-5 Q1. What will be the output of the following program segment Class Num { int x; float y; public: void init( ) { x = y = HOLIDAY HOMEWORK ASSIGNMENT-5 Q1. What will be the output of the following program segment Class Num { int x; float y; void init( ) { x = y = 0; void read(int i, float j) { x = i; y = j; void Display (

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

Q 1. Attempt any TEN of the following:

Q 1. Attempt any TEN of the following: Subject Code: 17212 Model Answer Page No: 1 / 26 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous

More information

Questions Bank. 14) State any four advantages of using flow-chart

Questions Bank. 14) State any four advantages of using flow-chart Questions Bank Sub:PIC(22228) Course Code:-EJ-2I ----------------------------------------------------------------------------------------------- Chapter:-1 (Overview of C Programming)(10 Marks) 1) State

More information

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++ Introduction to Programming in C++ Course Text Programming in C++, Zyante, Fall 2013 edition. Course book provided along with the course. Course Description This course introduces programming in C++ and

More information

Object-Oriented Programming (OOP) Fundamental Principles of OOP

Object-Oriented Programming (OOP) Fundamental Principles of OOP Object-Oriented Programming (OOP) O b j e c t O r i e n t e d P r o g r a m m i n g 1 Object-oriented programming is the successor of procedural programming. The problem with procedural programming is

More information

vinodsrivastava.com Constructor and Destructor

vinodsrivastava.com Constructor and Destructor vinodsrivastava.com Constructor and Destructor Constructor : it is a special member function of class with the following unique features 1. It has the same name as the name of the class they belongs to

More information

Fundamentals of Computer Programming Using C

Fundamentals of Computer Programming Using C CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar Faculty Name: Ami D. Trivedi Class: FYBCA Subject: US01CBCA01 (Fundamentals of Computer Programming Using C) *UNIT 3 (Structured Programming, Library Functions

More information

Write a C program using arrays and structure

Write a C program using arrays and structure 03 Arrays and Structutes 3.1 Arrays Declaration and initialization of one dimensional, two dimensional and character arrays, accessing array elements. (10M) 3.2 Declaration and initialization of string

More information