1 Marks Questions along with answers Topic: Programming in C++

Size: px
Start display at page:

Download "1 Marks Questions along with answers Topic: Programming in C++"

Transcription

1 1 Marks Questions with answers : Programming in C++ 1 Marks Questions along with answers Topic: Programming in C++ Class XII Ques 1. Answer: Ques 2. Answer: Ques 3. Answer: Ques 4. Answer: Ques 5. Answer: Name the header files to which the following belong (i) toupper() (ii) fabs() toupper( ) belongs to ctype.h, fabs( ) belongs to math.h Reusability of classes is one of the major properties of OOPs. How it is implemented in C++. Inheritance is the capability of one class of things to inherit capabilities or properties from another class. In C++ class inheriting its properties from another class is known as derived class. The class whose properties are inherited is known as base class. A derived class inherit properties from its base class thereby reuse a class. Hence inheritance implements reusability in C++. What do you mean by self-referential structure? Explain with an example A structure having a member element that refers to the structure itself is called self-referential structure for example: struct abc int a; abc *p; ; Explain nested structure with an example? A structure containing another structure is called nested of structure. struct Address.. ; struct emp Address A1; ; What is the significance of access specifiers in a class? A class provides three access labels private, protected and public. A member declared as private or protected remains hidden from outside world and it can only be access by the member functions of the class. A member declared as public is made available to the outside the world. Compiled By : Deepak Singh Gosain [PGT-CS, K.V. 2 Hubli]

2 1 Marks Questions with answers : Programming in C++ Ques 6. Answer: Ques7: What do you mean by inline function? explain with an example A inline function definition start with the keyword inline it is expended where it is declared for example inline float Square(float x) cout<<x * x; Write the names of the header files, which is/are essentially required to run/execute the following C++ code: void main() char CH,Text[]= +ve Attitude ; for(int I=0;Text[I]!= \0 ;I++) if(text[i]== ) else cout<<endl; CH=toupper(Text[I]); cout<<ch; Answer: Ques 8. Answer: Ques 9. Answer: Ques 10. Answer: iostream.h and ctype.h What is the difference between a and a? a is a character so it will occupy one byte in memory but a is a string so it will occupy two bytes in memory. How data and functions are organized in Object Oriented Programming? In Object Oriented Programming both data and functions are organized into a Single unit known as class. Why char is often treated as integer data type? The memory implementation of char data type is in terms of the associated number Code i.e. ASCII code which is integer. Therefore it is treated as int. Ques 11. When we should make a function inline and why? Answer: (1) The function is small, called often and not returning any value. (2) The function does contain a loop,switch or a goto. (3) It is not containing static variables and not recursive. Compiled By : Deepak Singh Gosain [PGT-CS, K.V. 2 Hubli]

3 1 Marks Questions with answers : Programming in C++ Ques 12. Ans. What is the use of typedef? typedef gives or defines an alternative name for a predefine data type. For Example. typedef float Dec; So now instead of using float we can defined float variables using Dec. Ques 13. Observe the program segment carefully and answer the question that follows: class member int member_no; char member_name[20]; void enterdetails( ); void showdetail( ); int getmember_no( ) return member_no; ; void update(member NEW ) fstream File; File.open( member.dat, ios::binary ios::in ios::out) ; member i; while(file.read((char*) & i, sizeof (i))) if(new. getmember_no( ) = = i. getmember_no( )) File.seekp(, ios::cur ) //Paremeter Missing File.write((char*) &NEW, sizeof (NEW)); File.close() ; If the function update( ) is supposed to modify a record in the file member.dat with the values ofmember NEW passed as argument, write the appropriate parameter for the missing parameter in theabove code, so as to modify record atits proper place. Answer:. File.seekp( -sizeof(i), ios::cur ); Ques 14 Observe the program segment given below carefully, and answer the question that follows: class Applicant long AId; //Applicant s Id char Name[20]; //Applicant s Name Compiled By : Deepak Singh Gosain [PGT-CS, K.V. 2 Hubli]

4 float Score; //Applicant s Score void Enroll(); void Disp(); void MarksScore(); //Function to change Score long R_Aid() return Aid; ; void ScoreUpdate(long Id) fstream File; File.open( APPLI.DAT,ios::binary ios::in ios::out); Applicant A; int Record=0,Found=0; while (!Found&&File.read((char*)&C, sizeof(c))) if (Id==A.R_Aid()) cout<< Enter new Score ; cin>>a.marksscore(); //statement 1 //statement 2 Found = 1; Record++; if(found==1) cout<< Record Updated ; File.close(); 1 Marks Questions with answers : Programming in C++ Write the Statement1 to position the File Pointer at the beginning of the Record for which the Applicant s Id matches with the argument passed, and Statement2 to write the updated Record at that position. Answer: Statement 1: (Write any one) File.seekp (Record * sizeof(a)); //object name OR File.seekp(Record * sizeof(applicant)); File.seekp(File.tellg() - sizeof(a)); File.seekp(File.tellg() - sizeof(applicant)); File.seekp(-sizeof(A), ios::cur); File.seekg(Record * sizeof(a)); File.seekg(Record * sizeof(applicant)); File.seekg(-sizeof(A), ios::cur); // class name OR OR OR OR Statement 2: (Write any one) File.write((char*)&A, sizeof(a)); OR Compiled By : Deepak Singh Gosain [PGT-CS, K.V. 2 Hubli]

5 File.write((char*)&A, sizeof(applicant)); 1 Marks Questions with answers : Programming in C++ Ques 15 Answer: A file named as STUDENT.DAT contains the student records, i.e. objects of class student.write the command to open the file to update a student record. (Use suitable stream class and file mode(s). fstream inof( STUDENT.DAT,ios::in ios::out ios::binary) OR fstream inof; inof.open( STUDENT.DAT,ios::in ios::out ios::binary) Compiled By : Deepak Singh Gosain [PGT-CS, K.V. 2 Hubli]

6 Compiled By : Deepak Gosain [ PGT-CS, K.V. 2, Hubli] 2 MARKS Qtions Subject : Computer Science Unit : Programming in C++ Class XII Q 1. Differentiate between a run-time and syntax error, give one example of each. Ans. A run-time error is an error that occurs during execution of a program. The compilation of program is not affected with it. For example, File could not be opened. not enough memory available are run time errors. A syntax error is that when statements are wrongly written violating rules of the programming language. For example max + 2 = dmax is a syntax error as an expression cannot appear on the left side of an assignment operator. Q 2. Ans: What is this pointer? What is its significance? this pointer represents an object that invokes a member function. It stores the address of the object that is invoking a member function and it (this pointer.) is an implicit argument to the member function being invoked. The this pointer is useful in returning the objects address of which the function is a member. Q 3. Give the difference between the type casting and automatic type conversion. Also, give a suitable C++ code to illustrate both. Q 4. What is the difference between a default constructor and copy constructor? Give suitable examples for each. Ans : Default constructor: -A constructor that accepts no parameters is called the default constructor. Copy constructor: -A copy constructor is a constructor of the form class name (class name &). The compiler will use the copy constructor whenever you initialize an instance using values of another instance of same type. Example: class XYZ int a; XYZ( ) //Default constructor

7 Compiled By : Deepak Gosain [ PGT-CS, K.V. 2, Hubli] a=10; XYZ( XYZ &s) //Copy constructor a=s.a; void getdata( ); void putdata( ); ; // end of the class Q 5. Ans: What do you understand by function overloading? Give an example illustrating its use in a C++ program. A function name having several definition that are differentiable by the number or types of their arguments, is known as an overloaded function and this process is known as Function Overloading. float xy(int a) return a*a; float xy(float a, float b) return a*b; Q 6. What do you mean by copy constructor? Explain with an example Ans : A constructor that initializes an object with the data values of another object is known as copy constructor. class abc int i,j; abc(int a, int b) i=a; j=b; abc(abc &s) j=s.j; i=s.j; void print(void) cout<<i<<j; ; void main() abc s1(2,4); abc s2(s1); abc s3=s1; Q 7. What will the order of the constructor invocation of the following code class date : ; class time

8 Compiled By : Deepak Gosain [ PGT-CS, K.V. 2, Hubli] : ; class train int rain(); date ddate; time dtime; ; void main() date d1; time t1; train tr1; Ans: The order of constructor invocation will be as follows : (i) (ii) (iii) (iv) (v) date::date() time::time() date::date() time::time() train::train() Q 8. Give the output of the following program: void main() int a=32,*ptr=&a; char ch,&cho=ch; cho+=a; *ptr+=ch; cout<<a<< <<ch <<endl; Output: 129 a Q 9. What is the difference between a Local and a Global Variable? And A Local Variable is accessible within its block in which it is declared but a global Variable is accessible in whole program. Ex. #include<iostream.h> #include<conio.h> int a=7; //global variable void main( ) int b=6; //local variable Q10. Rewrite the following program after removing the syntactical error(s) (if any). Underline each correction.

9 Compiled By : Deepak Gosain [ PGT-CS, K.V. 2, Hubli] #include <iostream.h> Class Item long IId,Qty; void Purchasecin>>IId>>Qty; void Sale() cout<<setw(5)<<iid<< Old: <<Qty <<endl; cout<< New: <<-- Qty<<endl; ; void main( ) Item I; Purchase(); I.Sale(); I.Sale() Ans: #include <iostream.h> #include <iomanip.h> class Item long IId,Qty; void Purchase()cin>>IId>>Qty; void Sale() cout<<setw(5)<<iid<< Old: <<Qty<<endl; cout<< New: <<-- Qty<<endl; ; void main() Item I; I.Purchase(); I.Sale(); I.Sale();

10 Compiled By : Deepak Gosain [ PGT-CS, KV-2, Hubli] 3 Marks Qtions along with Anss Subject : Computer Science Unit: Programming with C++ Class XII Q1. Observe the following C++ code carefully and obtain the output, which will appear on the screen after execution of it. #include<iostream.h> class Mausam int City,Temp,Humidity; Mausam(int C=1) City=C; Temp=10; Humidity=63; void Sun(int T) Temp+=T; ; void main() Mausam M,N(2); M.Sun(5); M.CheckOut(); N.Rain(10); N.Sun(2); N.CheckOut(); M.Rain(15); M.CheckOut(); Ans Output of the program will be : 1:15&63% 2:12&73% 1:15&78% Q 2. void Rain(int H) Humidity+=H; void CheckOut() cout<<city<<":"<<temp<<"&"<<humidity<<"%"<<endl; Give the output of the following program: #include <iostream.h> struct point int x,y; ; void show(point p) cout<<p.x<< : <<p.y<<endl; Ans: Output of the program will be : 25:20 40 : : 10 Q 3. Find the output of the following program. void main( ) point u=20,10,v,w; v = u; v.x += 20; w= v; u.y += 10; u.x += 5; show(u); show(v); show(w);

11 Compiled By : Deepak Gosain [ PGT-CS, KV-2, Hubli] #include <iostream.h> #include <string.h> void main( ) int chcount = 0,i=0, len; char ch[80] = Programming Language C++ ; len = strlen(ch); while(i <= (len-1)) chcount++; if(islower(ch[i])) ch[i]=toupper(ch[i]); else if (isupper(ch[i])) ch[i] = toupper(ch[i]); cout<<ch[i]; ++i; cout<<chcount; Output of the program will be: programming language c++ Q 4: Give the output of the following program : #include<iostream.h> int global=10; void func(int &x, int y) x=x-y; y=x*10; cout<<x<< <<y<< \n ; void main() int global=7; func(::global,global); cout<<global<<, <<::global<< \n ; func(global,::global); cout<<global<<, <<::global<< \n ; Ans: Output of the program will be: 3, 30 7, 3 4, 40 4, 3 Q 5. Give the output of the following program: #include<iostream.h> struct pixel int c,r; ; void display(pixel p) cout<<p.c<< # <<p.r<<endl; void main( ) pixel x=40,50,y,z; z=x; x.c+=10; y=z; y.c+=10; y.r+=20; z.c-=15; display(x); display(y); display(z);

12 Compiled By : Deepak Gosain [ PGT-CS, KV-2, Hubli] Ans: Output of the above program will be 50# # # 50 Q 6: Given the following code fragment: int x,b; class X int x; float y; char z; void init( ) x=y=z=0; int a,b; void sqr(int i) cout<<(x+y)*i; cout<<(a+b)*i; void start( int i,float j,char k) init( ); x=i; y=j; z=k; ; X ob1; void check( ) int a=10; cout<<a; i) What all variables can be access by the following functions sqr( ), start( ), check( ) Ans: Following data members will be accessed by the functions: sqr( ) can access X::x, ::x, X::y, X::z, X::a, X::b, ::b start( ) can access all the variables as that of sqr( ) function check( ) can access ::x, ::b, X::a, X::b and it s own local variable a. Q 7. Write a user defined function DispTen(int A[][4], int N, int M) In C++ to find and display all the numbers, which are divisible by 10. For example if the content of array is: The output should be Ans: C++ code for above problem :- #include<conio.h> #include<iostream.h> void Sum(int A[ ][3],int N,int M) int i,j,s=0; for(i=0;i<n;i++) for(j=0;j<m;j++) if(a[i][j]%10==0) cout<<a[i][j]<< ; void main() int a[][3]=12,20,13,2,10,30; clrscr(); Sum(a,2,3); getch();

13 Compiled By : Deepak Gosain [ PGT-CS, KV-2, Hubli] Q 8. Writes the output of the following program segment, consider all header files are include and necessary function call is there. char *name= ComPUteR ; for (int x=0;x<strlen(name);x++) if(islower(name[x])) name[x]=toupper(name[x]); else if(isupper(name[x])) if(x%2= =0) name[x]=tolower(name[x]); else name[x]=name[x-1]; puts(name); Ans: Otput of the above code: commutee Q 9. Write the output of the following program: #include<iostream.h> void execute(int &x, int y=200) int t=x+y; x+=t; if(y!=200) cout<<t<<<< : x<< : <<y<<endl; void main() int a=50,b=20; execute (b); cout<<a<< # <<b<<endl; execute(a,b); <<b<<endl; Ans: Output of the above code execution will be: 50 # : 340: @ 240 Q10. Write the output of the following program: #include<iostream.h> int calc(int u) if(u%2= =0) return(u+10); else return(u*2); void pattern(char m,int b=2) for(int c=0;c<b;c++) cout<<calc(c )<<m; cout<<endl; void main() pattern( * ); pattern( #,4);

14 Compiled By : Deepak Gosain [ PGT-CS, KV-2, Hubli] Ans: Otpput of the above code will be : 10*2* 10#2#12#6# 10@2@12@ Q 10. What will be the output of the following program #include<iostream.h> #include<ctype.h> #include<conio.h> #include<string.h> void changestring(char text[], int &counter) char *ptr = text; int length=strlen(text); for(;counter<length-2;counter+=2, ptr++) *(ptr+counter) = tolower(*(ptr+counter)); void main() clrscr(); int position = 0; char message[]= POINTERS FUN ; changestring(message, position); <<position; Ans:- Output the code will be: pointers fun@10 Q11 Assuming the class ANTIQUE as declared below, write a function in C++ to read the objects of ANTIQUE from binary file ANTIQUE.DAT and display those antique items, which are priced between and class ANTIQUE int ANO; char Aname[10]; float Price; void BUY() cin>>ano; gets(aname); cin>>price; void SHOW() cout<<ano<<endl; cout<<aname<<endl; cout<<price<<endl;

15 Compiled By : Deepak Gosain [ PGT-CS, KV-2, Hubli] ; float GetPrice() return Price; Ans: C++ code for the above program will be: Q12 Write a function in C++ to search for the details (Phoneno and Calls) of those Phones, which have more than 800 calls from a binary file phones.dat. Assuming that this binary file contains records/objects of class Phone, which is defined below. class Phone char Phoneno[10]; int Calls; void Get( ) gets(phoneno); cin>>calls; void Billing( ) cout<<phoneno<< # <<Calls<<endl; int GetCalls( ) return Calls; ; Ans : C++ code for the searching is :- void search () Phone pobj; ifstream ifs; ifs.open("phones.dat",ios::binary); while(ifs.read((char*)&pobj,sizeof(pobj))) if(pobj.getcalls()> =800) pobj.billing(); ifs.close();

16 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] Q1. Define a class Applicant in C++ with following description: Private Members A data member ANo (Admission Number) of type long A data member Name of type string A data member Agg (Aggregate Marks) of type float A data member Grade of type char A member function GradeMe() to find the Grade as per the Aggregate Marks obtained by a student. Equivalent Aggregate Marks range and the respective Grades are shown as follows: Aggregate Marks Grade >=80 A Less than 80 and >=65 B Less than 65 and >=50 C Less than 50 D Public Members A function ENETR() to allow user to enter values for ANo,Name,Agg & call function GradeMe() to find the Grade. A function RESULT() to allow user to view the content of all the data members. Ans1: C++ Code for the above class is: class Applicant long ANo; char Name[20],Grade; float Agg; void GradeMe(); void ENETR(); void RESULT(); ; void Applicant::ENETR() cin>>ano; gets(name); cin>>agg; GradeMe(); void Applicant::GradeMe() if(agg<50) Grade='D'; else if(agg>=50 && Agg<65) Grade='C'; else if(agg>=65 && Agg<80) Grade='B'; else Grade='A'; void Applicant::RESULT() cout<<ano<<'\t'<<name<<'\t'<<agg<<'\t <<Grade<<endl; Q2 : Answer the questions (i) and (iv) based on the following: Page : 1

17 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] class Student int Rollno; char SName[20]; float Marks1; protected: void Result(); Student(); void Enroll(); void Display(); ; class Teacher long TCode; char TName[20]; protected: float Salary; Teacher (); void Enter(); void Show(); ; class Course:public Student,private Teacher long CCode[10] char CourseName[50]; char StartDate[8],EndDate[8]; Course(); void Commence(); void CDetail(); ; (i) Write the names of member functions, which are accessible from objects of class Course. Ans: Commence() CDetail() Enroll() Display() (ii) Write the names of all data members, which is/are accessible from member function Commence of class Course. Ans: Salary CCode CourseName StartDate EndDate (iii) Write the names of all the members, which are accessible from objects of class teacher. Enter() Show() (iv) Which type of inheritance is illustrated in the above C++ code? Ans. Multiple Inheritance Q3. Write a function in C++ to perform Insert operation on a dynamic Queue containing DVD'S information (represented with the help of an array of structure DVD). Page : 2

18 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] Ans : struct DVD long No; char Title[20]; ; //DVD Nunber //DVD Title DVD *Link; class Queue DVD *Front, *Rear; Queue ( ) Front = NULL; Rear = NULL; void Insert() ; void Remove() ; void Display() ; ~Queue() ; ; void Queue::Insert() DVD *T = new DVD; Cin>>T->No; gets (T->Title) ; //OR cin.getline(t->title,20); T->Link = NULL; if (Rear=NULL) Front = T; Rear = T; else Rear->Link = T; Rear = T; Q4. Define a class SUPPLY in C++ with following description: Private Members Code of type int FoodName of type string Sticker of type string Food Type of type string A member function GetType() to assign the following values for Food Type as per the given Sticker: Sticker Food Type GREEN Vegetarian YELLOW Contains Egg RED NON-Vegetarian Public Members A function Foodln ( ) to allow user to enter values for Code, FoodName, Sticker and call function Page : 3

19 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] GetType( ) to assign respective FoodType. A function FoodOut ( ) to allow user to view the content of all the data members. Ans: Code for the above class will be: class SUPPLY int Code; char FoodName [20] ; char Sticker [10] ; char FoodType[20]; void GetType(); void FoodIn() ; void FoodOut() ; ; void SUPPLY::GetType() if (strcmp (Sticker,"GREEN")==0) strcpy(foodtype, "Vegeterian"); else if (strcmp (Sticker, "YELLOW") =0) strcpy(foodtype, "Contains Egg") ; else if (strcmp(sticker,"red")==0) strcpy(foodtype, "Non-Vegeterian"); void SUPPLY::FoodIn() cin>>code; gets (FoodName) ; gets (Sticker) ; GetType() ; void SUPPLY:: FoodOut() cout<<code<<foodname<<sticker<<foodtype<<endl; Q5: Write a function in C++ to perform Push operation on a dynamically allocated Stack containing real numbers Ans: struct stack float info; stack *next; Top; void push( ) stack *T; T=new stack; If(T==NULLl) cout<< Overflow ; exit(0); else If(Top==NULL) Top=T; else cout<< \nenter Number : ; cin>>t->info; T->next=Top; Top=T; Q6. Answer the questions (i) to (iv) based on the following code based on inheritance Page : 4

20 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] 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[10]; protected : int amount; public : Payment(); ~Payment(); void show(); ; 1. Name the type of Inheritance depicted in the above example. Ans: Multilevel Inheritance 2. Name the member functions accessible through the object of class Payment. Ans; show( ) 3. How many bytes are required for the object of class Payment. Ans 58 bytes 4. Name the base & derived class of Daily_wager class. Ans Base class : Employee Derived class: Payment Practice Questions : Do yourself Page : 5

21 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] Q1: Define a class named MyFolder with the following specifications: Private members: Filenames - an array of strings of size[10][25] (to represent all the names of files inside Myfolder) Availspace - long (to represent total number of bytes available in MyFolder) Usedspace - long (to represent total number of bytes used in MyFolder) Public members Newfileentry() Retavailspace() Showfiles() - a function to accept values of Filenames, Availspace and Usedspace from user. - A function that returns the value of total Kilobytes available. (1 Kilobyte = 1024 bytes) - A function that displays the names of all the files in MyFolder Ans 7: C++ codes for above specification are:- #include<iostream.h> #include<stdio.h> #include<conio.h> class Myfolder char Filenames[10][25]; long Availspace, Usedspace ; void Newfileentry( ) for(int i=0;i<10;i++) cout<< \n Enter Files name : ; gets(filenames(i)); cout<< \nenter Available Space and Used Space: ; cin>>availspace>>usedspace; float Retavailspace( ) return( (float)availspace/1024) void showfiles( ) Cout<< \nlist of files are as follows ; for(int i=0;i<10;i++) cout<< \n <<Filenames(i); ; // end of class Page : 6

22 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] Q9: Define a class TEST in C++ with following description: Private Members a. TestCode of type integer b. Description of type string c. NoCandidate of type integer d. CenterReqd (number of centers required) of type integer e. A member function CALCNTR() to calculate and return the number of centers as (NoCandidates/100+1) Public Members A function SCHEDULE() to allow user to enter values for TestCode, Description, NoCandidate & call function CALCNTR() to calculate the number of Centres A function DISPTEST() to allow user to view the content of all the data members Ans: class TEST int TestCode; char Description[20]; int NoCandidate,CenterReqd; void CALCNTR(); void SCHEDULE(); void DISPTEST(); ; void TEST::CALCNTR() CenterReqd=NoCandidate/ ; void TEST::SCHEDULE() cout<< Test Code : ;cin>>testcode; cout<< Description : ;gets(description); cout<< Number : ;cin>>nocandidate; CALCNTR(); void TEST::DISPTEST() cout<< Test Code : <<TestCode<<endl; cout<< Description : <<Description<<endl; cout<< Number : <<NoCandidate<<endl;; cout<< Centres : <<CenterReqd<<endl;; Q10: Write a function in C++ to perform Insert operation in a dynamically allocated Queue containing names of students. Page : 7

23 4 Marks question based on C++ OOP Programming Class XII Computer Science Compiled By : Deepak Gosain [ PGT CS-K.V.2, Hubli] Ans: A function in C++ to perform Insert operation in a dynamically allocated Queue containing names of students is as follows : struct NODE char Name[20]; NODE *Link; ; class QUEUE NODE *Rear,*Front; QUEUE(); void Insert(); void Delete(); ; void QUEUE::Insert() NODE *Temp; Temp=new NODE; gets(temp->name); Temp->Link=NULL; if (Rear==NULL) Rear=Temp; Front=Temp; else Rear->Link=Temp; Rear=Temp; Page : 8

High Order Thinking Skill Questions Subject : Computer Science Class: XII 1 Mark Questions Programming in C++ 1. Observe the program segment carefully and answer the question that follows: int getitem_no(

More information

KENDRIYA VIDYALYA CLRI COMPUTER SCIENCE XII WORKSHEET ON OUTPUT QUESTIONS

KENDRIYA VIDYALYA CLRI COMPUTER SCIENCE XII WORKSHEET ON OUTPUT QUESTIONS KENDRIYA VIDYALYA CLRI COMPUTER SCIENCE XII WORKSHEET ON OUTPUT QUESTIONS 1. What will be the output of following: void main ( ) int val = 10; cout

More information

QUESTION BANK SUB: COMPUTER SCIENCE(083)

QUESTION BANK SUB: COMPUTER SCIENCE(083) BHARATIYA VIDYA BHAVAN S V M PUBLIC SCHOOL, VADODARA QUESTION BANK SUB: COMPUTER SCIENCE(083) CHAPTER 6 Pointers 2 MARKS QUESTION 1. Rewrite the following codes after removing errors, if any, in the following

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

Guru Harkrishan Public School, Karol Bagh Pre Mock Class XII Sub: COMPUTER SCIENCE Allowed :3 hrs

Guru Harkrishan Public School, Karol Bagh Pre Mock Class XII Sub: COMPUTER SCIENCE Allowed :3 hrs Guru Harkrishan Public School, Karol Bagh Pre Mock 2014-15 Class XII Sub: COMPUTER SCIENCE Time Allowed :3 hrs M.M. 70 Please check that this question paper contains 9 printed pages. Please check that

More information

Computer Science, Class XII ( ) (Summer Vacation-2015) (Holiday H.W) Chapter No.1 to 3

Computer Science, Class XII ( ) (Summer Vacation-2015) (Holiday H.W) Chapter No.1 to 3 (Summer Vacation-2015) (Holiday H.W) Chapter No.1 to 3 1. Why main function is so special in C++? Give at least two reasons. /* CBSE 1999 */ 2. Differentiate between call by value & call by reference with

More information

KENDRIYA VIDYALAYA NO.02 AFS HINDAN G.BAD Holiday Homework Class XII Computer Science

KENDRIYA VIDYALAYA NO.02 AFS HINDAN G.BAD Holiday Homework Class XII Computer Science KENDRIYA VIDYALAYA NO.02 AFS HINDAN G.BAD Holiday Homework 2018-19 Class XII Computer Science Topics covered 1) Classes and objects 2) Constructors and destructors 3) Inheritance 4) Review of class XI

More information

If the function modify( ) is supposed to change the mark of a student having student_no y in the file student.dat, write the missing statements to modify the student record. 10. Observe the program segment

More information

JB Academy, Faizabad Half Yearly Examination Subject: Computer Science (083) Class XII

JB Academy, Faizabad Half Yearly Examination Subject: Computer Science (083) Class XII JB Academy, Faizabad Half Yearly Examination - 2017-18 Subject: Computer Science (083) Class XII Time: 3 Hours Max. Marks: 70 Instructions: i) All questions are compulsory and so attempt all. ii) Programming

More information

COMPUTER SCIENCE (Theory) - Class XII Marking Scheme Sample Question Paper I Subject Code - 083

COMPUTER SCIENCE (Theory) - Class XII Marking Scheme Sample Question Paper I Subject Code - 083 COMPUTER SCIENCE (Theory) - Class XII Marking Scheme Sample Question Paper I Subject Code - 083 TIME : 3 Hrs MM : 100 No. Answers Marks 1. (a) Global Variable Local Variable 2 l It is a variable which

More information

[Time allowed : 3hours] [Maximum Marks: 70] Instructions (i) All questions are compulsory (ii) Programming Language: C++

[Time allowed : 3hours] [Maximum Marks: 70] Instructions (i) All questions are compulsory (ii) Programming Language: C++ 1(a) XII COMPUTER SCIENCE CBSE Board - 011 [Time allowed : 3hours] [Maximum Marks: 70] Instructions (i) All questions are compulsory (ii) Programming Language: C++ What is the difference between Type Casting

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

QUESTION BANK SUB: COMPUTER SCIENCE(083)

QUESTION BANK SUB: COMPUTER SCIENCE(083) BHARATIYA VIDYA BHAVAN S V M PUBLIC SCHOOL, VADODARA QUESTION BANK SUB: COMPUTER SCIENCE(083) CHAPTER 5 Data File Handling 1 Mark Questions 1. Observe the program segment carefully and answer the question

More information

Computer programs are associated to work with files as it helps in storing data & information permanently. File - itself a bunch of bytes stored on

Computer programs are associated to work with files as it helps in storing data & information permanently. File - itself a bunch of bytes stored on Computer programs are associated to work with files as it helps in storing data & information permanently. File - itself a bunch of bytes stored on some storage devices. In C++ this is achieved through

More information

void main() { int global=7 ; func( ::global,global) ; cout<<global<<, <<::global<< \n ; func(global,::global) ; cout<<global<<, <<::global<< \n ; }

void main() { int global=7 ; func( ::global,global) ; cout<<global<<, <<::global<< \n ; func(global,::global) ; cout<<global<<, <<::global<< \n ; } K.V.NO.3 AFS CHAKERI AUTUMN BREAK HOME WORK 2017-18 CLASS-XII 1. a) Differentiate between an identifier and keywords. b) Name the header files, to which following inbuilt function belong to: a) abs( )

More information

http:/// 1(a) Ans: Sample Paper 2014 Class XII Subject COMPUTER SCIENCE [Time allowed : 3hours] [Maximum Marks: 70] Instructions (i) All questions are compulsory (ii) Programming Language: C++ What is

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

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

KUWAIT SAHODAYA EXAMINATION FIRST TERM SUBJECT : COMPUTER SCIENCE (083) : CLASS - XII SET - 3 Time : 3 Hours

KUWAIT SAHODAYA EXAMINATION FIRST TERM SUBJECT : COMPUTER SCIENCE (083) : CLASS - XII SET - 3 Time : 3 Hours KUWAIT SAHODAYA EXAMINATION FIRST TERM 08-09 SUBJECT : COMPUTER SCIENCE (08) : CLASS - XII SET - Time : Hours MM=70 Instructions- (Based on the model of CBSE Exams). a) Find and write the output of the

More information

Home Assignment for Class XII(Summer Vacation) Subject: CS Based on Library Functions ( 1 Mark)

Home Assignment for Class XII(Summer Vacation) Subject: CS Based on Library Functions ( 1 Mark) Home Assignment for Class XII(Summer Vacation) Subject: CS Based on Library Functions ( 1 Mark) Q1. Write the names of the header files to which the following belong: (i) isdigit() (vi) setw() (ii) strcmp()

More information

Guru Gobind Singh Public School Sector: V/B, Bokaro Steel City Assignment (Level 2)

Guru Gobind Singh Public School Sector: V/B, Bokaro Steel City Assignment (Level 2) Subject : Computer Science Class : XII Guru Gobind Singh Public School Sector: V/B, Bokaro Steel City Assignment (Level 2) 1. Out of the following, find those identifiers, which cannot be used for naming

More information

I Mid Semester May 2012 : Class XII : Computer Science Max Mark 50 : Time 2 Hrs. 1. a) What is macro in C++? Give example 2

I Mid Semester May 2012 : Class XII : Computer Science Max Mark 50 : Time 2 Hrs. 1. a) What is macro in C++? Give example 2 I Mid Semester May 01 : Class XII : Computer Science Max Mark 50 : Time Hrs 1. a) What is macro in C++? Give example b) Give the Header file for the following functions:- i) gets ( ) ii) tolower( ) 1 c)

More information

CBSE 12th Computer Science Question Papers

CBSE 12th Computer Science Question Papers CBSE 12th Computer Science Question Papers General Instructions: a) This paper consist question from 1 to 7. b) Marks are mentioned to each questions for your convenience. c) The given paper is of total

More information

KENDRIYA VIDYALAYA NO.1 SAGAR XII-COMPUTER SCIENCE ( ) HOMEWORK SUMMER VACATION

KENDRIYA VIDYALAYA NO.1 SAGAR XII-COMPUTER SCIENCE ( ) HOMEWORK SUMMER VACATION KENDRIYA VIDYALAYA NO.1 SAGAR XII-COMPUTER SCIENCE (2018-19) HOMEWORK SUMMER VACATION 1.(a) Differentiate between Actual and Formal parameters. Also give suitable C++ code to illustrate both. (b) What

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

Q2) Define a class candidate in C++ with following Description: Private Members 4 Number) of type long

Q2) Define a class candidate in C++ with following Description: Private Members 4 Number) of type long KVITBP DEHRADUN SUMMER BREAK HOMEWORK, XII COMP SC, LEVEL A Q1) Define a class TEST in C++ with following description: Private Members: TestCode of type integer Description of type string NoCandidate of

More information

BHARATIYA VIDYA BHAVAN S V.M.PUBLIC SCHOOL, VADODARA. Class : XII SAMPLE PAPER Max Marks : 70

BHARATIYA VIDYA BHAVAN S V.M.PUBLIC SCHOOL, VADODARA. Class : XII SAMPLE PAPER Max Marks : 70 BHARATIYA VIDYA BHAVAN S V.M.PUBLIC SCHOOL, VADODARA Class : XII SAMPLE PAPER Max Marks : 70 Subject : Computer Science Time Allotted : 3 hrs General Instructions : Programming Language : C++. All questions

More information

void Add() { cin >> trainnumber; gets(trainname); } void display() { cout<<trainnumber <<":"<<TrainName<<end;

void Add() { cin >> trainnumber; gets(trainname); } void display() { cout<<trainnumber <<:<<TrainName<<end; . T SHREE MAHAPRABHU PUBLIC SCHOOL & COLLEGE QUESTION BANK FOR BOARD EXAMINATION 016-17 SUBJECT COMPUTER SCIENCE (Code: 083) Q1. Answer the following questions: a) Name the header file(s) that shall be

More information

KENDRIYA VIDYALAYA SANGATHAN, COMPUTER SCIENCE (THEORY) I PRE-BOARD TIME 3 HRS CLASS XII M. Marks 70

KENDRIYA VIDYALAYA SANGATHAN, COMPUTER SCIENCE (THEORY) I PRE-BOARD TIME 3 HRS CLASS XII M. Marks 70 KENDRIYA VIDYALAYA SANGATHAN, COMPUTER SCIENCE (THEORY) I PRE-BOARD TIME 3 HRS CLASS XII M. Marks 70 GENERAL INSTRUCTIONS : 1. ALL QUESTIONS ARE COMPULSORY. 2. PROGRAMMING LANGUAGE : C++ Q1. (a) Out of

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

CLASS XII COMPUTER SCIENCE(083) TimeAllowed : 3 HrsMax Marks : 70

CLASS XII COMPUTER SCIENCE(083) TimeAllowed : 3 HrsMax Marks : 70 1 CLASS XII COMPUTER SCIENCE(083) TimeAllowed : 3 HrsMax Marks : 70 General Instructions- (i) All questions are compulsory (ii) Programming Language: C++ 1. (a) Differentiate between call-by-value and

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

COMPUTER SCIENCE 1998 (Delhi Board)

COMPUTER SCIENCE 1998 (Delhi Board) COMPUTER SCIENCE 1998 (Delhi Board) Time allowed: 3 hours Max. Marks: 70 Instructions: (i) All the questions are compulsory. (ii) Programming Language: C++ QUESTION l. (a) Define the following terms: (i)

More information

Code No. 083 Time allowed: 3 hours Maximum Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming language: C++

Code No. 083 Time allowed: 3 hours Maximum Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming language: C++ Sample Paper Class XII Subject Computer Science Please check that this question paper contains 7 printed pages. Code number given on the right hand side of the question paper should be written on the title

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

Code No. 91. (i) All questions are compuls9ry. 1. (a) What is the difference between Type Casting and Automatic Type

Code No. 91. (i) All questions are compuls9ry. 1. (a) What is the difference between Type Casting and Automatic Type r--- - -"" -.!':,c', I Series 50S I Code No. 91. I I I I I I I I Candidates must write the Code on Roll No. I I I I I I I I the title page of the answer-book.. Please check that this question paper contains

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

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet BRAIN INTERNATIONAL SCHOOL Term-I Class XI 2018-19 Sub: Computer Science Revision Worksheet Chapter-1. Computer Overview 1. Which electronic device invention brought revolution in earlier computers? 2.

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 VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015

KENDRIYA VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015 KENDRIYA VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015 CLASS: XII COMPUTER SCIENCE TIME: 1½ hrs TOTAL MARKS: 35 1. How can we make private members inheritable? (1) 2. Find out errors in the following program:-

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

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

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

void display(){ cout << trainno.<< :>>Description<<endl; }; void main() {TRAIN T; Entry.(); Display.(); d) 410 e) i) south:east:south f) temttoe

void display(){ cout << trainno.<< :>>Description<<endl; }; void main() {TRAIN T; Entry.(); Display.(); d) 410 e) i) south:east:south f) temttoe Marking Scheme SUBJECT COMPUTER SCIENCE Class XII Ist Preboard 2016 Q. No. 1 a) 1 Marks for definition and 1 marks for explain relation with classes objects. the wrapping of data and operation / function

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

SAMPLE PAPER. Class: XII SUBJECT COMPUTER SCIENCE. Time: 3 Hours MM: 70

SAMPLE PAPER. Class: XII SUBJECT COMPUTER SCIENCE. Time: 3 Hours MM: 70 SAMPLE PAPER Class - XII SUBJECT COMPUTER SCIENCE Subject: Computer Sc. Class: XII Time: 3 Hours MM: 70 1. (a) Differentiate between a global variable and a local variable. (b) Name the Header file(s)

More information

Downloaded from

Downloaded from SAMPLE PAPER 4 COMPUTER SCIENCE (083) CLASS XII Time allowed: 3Hrs Maximum Marks :70 Instructions: i) All the questions are compulsory ii) Programming Language C++ 1. (a) What is the difference between

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

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

Object Oriented Programming Using C++ UNIT-3 I/O Streams

Object Oriented Programming Using C++ UNIT-3 I/O Streams File - The information / data stored under a specific name on a storage device, is called a file. Stream - It refers to a sequence of bytes. Text file - It is a file that stores information in ASCII characters.

More information

Downloaded S. from Kiran, PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from

Downloaded S. from Kiran,  PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from Downloaded S. from Kiran, www.studiestoday.com PGT (CS) KV, STRUCTURES WHAT IS A STRUCTURE? Structure is a collection of logically related data. It is also a collection of dissimilar datatype. Downloaded

More information

CLASS XII SECOND TERM EXAMINATION SUBJECT : COMPUTER SCIENCE SET A2 (SOLUTIONS)

CLASS XII SECOND TERM EXAMINATION SUBJECT : COMPUTER SCIENCE SET A2 (SOLUTIONS) CLASS XII SECOND TERM EXAMINATION 2017-2018 SUBJECT : COMPUTER SCIENCE SET A2 (SOLUTIONS) TIME ALLOWED : 3 HRS. MAX. MARKS:70 General Instructions : This paper consists of 6 questions. There are 7 printed

More information

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013 Q.2 a. Discuss the fundamental features of the object oriented programming. The fundamentals features of the OOPs are the following: (i) Encapsulation: It is a mechanism that associates the code and data

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

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

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

After going through this lesson, you would be able to: store data in a file. access data record by record from the file. move pointer within the file

After going through this lesson, you would be able to: store data in a file. access data record by record from the file. move pointer within the file 16 Files 16.1 Introduction At times it is required to store data on hard disk or floppy disk in some application program. The data is stored in these devices using the concept of file. 16.2 Objectives

More information

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example:

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example: POINTERS Pointer is a memory variable which can store address of an object of specified data type For example: #include int x=5; int *a;//here a is a pointer to int which can store address of

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

COMPUTER SCIENCE (Theory) - Class XII Marking Scheme

COMPUTER SCIENCE (Theory) - Class XII Marking Scheme COMPUTER SCIENCE (Theory) - Class XII Marking Scheme 1 a) Call by value l It is a used to create a temporary copy of data coming from actual parameter.the changes done in the function in the formal parameter

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

Unit-V File operations

Unit-V File operations Unit-V File operations What is stream? C++ IO are based on streams, which are sequence of bytes flowing in and out of the programs. A C++ stream is a flow of data into or out of a program, such as the

More information

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION CLASS:XII - (COMPUTER SCIENCE )

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION CLASS:XII - (COMPUTER SCIENCE ) KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION 2014-15 CLASS:XII - (COMPUTER SCIENCE ) MaxMarks:70 Time Allowed :3 Hours Instructions: (i) All questions are compulsory.

More information

PRINCE PUBLIC SCHOOL PRE-BOARD EXAMINATION ( ) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS

PRINCE PUBLIC SCHOOL PRE-BOARD EXAMINATION ( ) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS PRINCE PUBLIC SCHOOL PRE-BOARD EXAMINATION (2018-19) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS MAXIMUM MARKS: 70 General Instructions 1. This question paper contains 7 questions. 2. SECTION

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

Functions. Introduction :

Functions. Introduction : Functions Introduction : To develop a large program effectively, it is divided into smaller pieces or modules called as functions. A function is defined by one or more statements to perform a task. In

More information

CBSE GUESS PAPER. Roll No. Computer Sc. XII(083)/

CBSE GUESS PAPER. Roll No. Computer Sc. XII(083)/ Roll No. CBSE GUESS PAPER Computer Sc. XII(083)/2011-12 Time Allowed 3 Hours Maximum Marks- 70 General Instructions: (i) All questions are compulsory. (ii) The paper contains 7 questions. (iii) Programming

More information

COMPUTER SCIENCE (083)

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

More information

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

DELHI PUBLIC SCHOOL BOKARO STEEL CITY DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION 2015-2016 Class: XII Subject : Computer Science Assignment No. 3 Question 1: (a) What is the difference between Call by Value and Call by

More information

Model Sample Paper 2015

Model Sample Paper 2015 Time: 3 Hours MM: 70 Model Sample Paper 2015 Class XII Computer Science (083) Instructions: (i) (ii) All questions are compulsory. Programming Language C++. 1. (a) What is the difference between Actual

More information

KENDRIYA VIDYALAYA SANGATHAN, VARANASI REGION

KENDRIYA VIDYALAYA SANGATHAN, VARANASI REGION KENDRIYA VIDYALAYA SANGATHAN, VARANASI REGION FIRST PRE-BOARD EXAMINATION 016-17 CLASS XII COMPUTER SCIENCE (083) Time: 3 hours Max. Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming

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

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer:

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer: Chapter-11 POINTERS Introduction: Pointers are a powerful concept in C++ and have the following advantages. i. It is possible to write efficient programs. ii. Memory is utilized properly. iii. Dynamically

More information

Downloaded from 1 Mark Questions Programming in C++

Downloaded from   1 Mark Questions Programming in C++ 1 Mark Questions Programming in C++ 1. Observe the program segment carefully and answer the question that follows: class item int item_no; char item_name[20]; void enterdetail( ); void showdetail( ); int

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

Kapi ap l S e S hgal P T C p t u er. r S. c S ienc n e A n A k n leshw h ar ar Guj u arat C C h - 8

Kapi ap l S e S hgal P T C p t u er. r S. c S ienc n e A n A k n leshw h ar ar Guj u arat C C h - 8 Chapter 8 Introduction C++ Memory Map Free Stores Declaration and Initialization of pointers Dynamic allocation operators Pointers and Arrays Pointers and Const Pointers and Function Pointer and Structures

More information

Marking Scheme Computer Science

Marking Scheme Computer Science Marking Scheme Computer Science General Instructions : Marking scheme is the final document for all references with regard to evaluation and cannot be altered under any circumstances The answers given

More information

KE DRIYA VIDYALAYA SA GATHA CHE AI REGIO COMMO PREBOARD EXAMI ATIO COMPUTER SCIE CE- CLASS- XII. Marking scheme

KE DRIYA VIDYALAYA SA GATHA CHE AI REGIO COMMO PREBOARD EXAMI ATIO COMPUTER SCIE CE- CLASS- XII. Marking scheme KE DRIYA VIDYALAYA SA GATHA CHE AI REGIO COMMO PREBOARD EXAMI ATIO 2008-09 COMPUTER SCIE CE- CLASS- XII Marking scheme 1(a) On program execution, the compiler starts execution from the function main().this

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

ITL Public School Pre-Board( ) Computer Science (083) Time:3 hrs M. M: 70

ITL Public School Pre-Board( ) Computer Science (083) Time:3 hrs M. M: 70 ITL Public School Pre-Board(04-5) Date:..04 Class:XII Computer Science (08) Time: hrs M. M: 70 General Instructions:. Programming Language C++. Try to give Examples a) What is the difference between Actual

More information

BRAIN INTERNATIONAL SCHOOL Term-II Class-XI Sub:- Computer Science Revision Sheet

BRAIN INTERNATIONAL SCHOOL Term-II Class-XI Sub:- Computer Science Revision Sheet BRAIN INTERNATIONAL SCHOOL Term-II Class-XI 2018-19 Computer Organisation Sub:- Computer Science Revision Sheet 1. Which electronic device invention brought revolution in earlier computers? 2. Which memory

More information

CS 103: Introduction to Programming Fall Written Final Exam 12/11/16, 4:30PM 6:30PM

CS 103: Introduction to Programming Fall Written Final Exam 12/11/16, 4:30PM 6:30PM CS 103: Introduction to Programming Fall 2017 - Written Final Exam 12/11/16, 4:30PM 6:30PM Name: USC Email Address: Lecture (Circle One): Redekopp 2:00 TTh Goodney: 2 MW 9:30 TTh 11:00 TTh Complete 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

Come and join us at WebLyceum

Come and join us at WebLyceum Come and join us at WebLyceum For Past Papers, Quiz, Assignments, GDBs, Video Lectures etc Go to http://www.weblyceum.com and click Register In Case of any Problem Contact Administrators Rana Muhammad

More information

Downloaded from

Downloaded from QUARTERLY EXAMINATION, 2013 14 SUBJECT: COMPUTER SCIENCE TIME : 3 hrs CLASS : XII M.M.-70 Instructions: (1) All the questions are compulsory. (2) Programming Language C++ 1 (a) Illustrate the concept of

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

(4) Find the syntax error(s), if any, in the following program: #include main() int x[5],*y,z[5]; for(i=0;i<5;i++) x[i]=i; z[i]=i+3; y=z; x=y; (5) Rew

(4) Find the syntax error(s), if any, in the following program: #include main() int x[5],*y,z[5]; for(i=0;i<5;i++) x[i]=i; z[i]=i+3; y=z; x=y; (5) Rew (1)Rewrite the following program after removing the syntactical error(s), if any Underline each correction, struct TV char Manu_name[20]; char Tv_Type; int Price = 17000; New Tv; gets(manu_name); gets(tv_type);

More information

Computer Science, Class XII, Chapter No.7 (Data File Handling)

Computer Science, Class XII, Chapter No.7 (Data File Handling) Chapter No.7 (Data File Handling) 1. What is a file? How a text file is different from binary file? 2. What is stream? Name and define the streams generally used for file I/O? 3. Which header file is required

More information

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

#include<iostream.h> #include<conio.h> #include<ctype.h> Sample Paper -205 Sub:Computer Science Class XII Time: 3Hours Maximum Marks: 70 Note. (i) All questions are compulsory. (ii) Programming Language: C++.(a)Give the difference between the type casting and

More information

ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE

ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE ASSIGNMENT CLASS : XII (2015-16) COMPUTER SCIENCE Short answer typequestions: 1.(a)What is the difference between logical error and runtime error? Give suitable example for the same. (b) What is the difference

More information

What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable.

What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable. CHAPTER 08 POINTERS What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable. The Pointers are one of the C++ s most useful and powerful features. How Pointers

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

PART I. Part II Answer to all the questions 1. What is meant by a token? Name the token available in C++.

PART I.   Part II Answer to all the questions 1. What is meant by a token? Name the token available in C++. Unit - III CHAPTER - 9 INTRODUCTION TO C++ Choose the correct answer. PART I 1. Who developed C++? (a) Charles Babbage (b) Bjarne Stroustrup (c) Bill Gates (d) Sundar Pichai 2. What was the original name

More information

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED. Constructor and Destructor Member Functions Constructor: - Constructor function gets invoked automatically when an object of a class is constructed (declared). Destructor:- A destructor is a automatically

More information

CSE202-Lec#4. CSE202 C++ Programming

CSE202-Lec#4. CSE202 C++ Programming CSE202-Lec#4 Functions and input/output streams @LPU CSE202 C++ Programming Outline Creating User Defined Functions Functions With Default Arguments Inline Functions @LPU CSE202 C++ Programming What is

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

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

PESIT Bangalore South Campus

PESIT Bangalore South Campus USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of ECE INTERNAL ASSESSMENT TEST 2 Date : 03/10/2017 Marks: 40 Subject & Code : Object Oriented Programming

More information

1. a) Find the correct identifiers out of the following, which can be 2 used for naming Variable, Constants or Functions in a C++ program:

1. a) Find the correct identifiers out of the following, which can be 2 used for naming Variable, Constants or Functions in a C++ program: SECOND PREBOARD EXAMINATION (2017 18) CLASS: XII Subject: COMPUTER SCIENCE Date: 24.1.2018 Time Allowed: 3 Hours Maximum Marks: 70 General instructions: (1) All questions are compulsory. (2) Marks are

More information