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

Size: px
Start display at page:

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

Transcription

1 (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 a suitable example in C++. /*CBSE 2005, 2009, 2010, 2014 */ 3. What do you mean by actual parameter and formal parameter? Explain with an example. /*CBSE 2009 */ 4. Differentiate between global & local variable with a suitable example in C++. /* CBSE 2003 */ 5. Illustrate the use of #define in C++ to define a macro. /* CBSE 2006 */ 6. What do you understand by syntax error, logical error & run time error? Explain with example. /*CBSE 2007 */ 7. Find the correct identifiers out of the following, which can be used for naming variable, constants and functions in a C++ programs: /*CBSE 2015 */ For, while, INT, NeW, delete, 1stName, Add+Subtract, name1 8. Give the difference between the type casting and automatic type conversion. Also, give a suitable C++ code to illustrate both. /*CBSE 2011, 2012 */ 9. What do you mean by token? Difference between identifier and keyword with an example. 10. How is entry controlled loop different from exit controlled loop? Explain with one example of each. 11. What is the purpose of using a typedef command in C++? Explain with suitable example. /* CBSE 2008 */ 12. What is the difference between a typedef name and a reference name in C++? Explain with suitable example. 13. What is the difference between a typedef name and a reference name in C++? Explain with suitable example. 14. What are Nested Structures? Give an example. /* CBSE 2006 */ 15. What is the difference between #define & const? Explain through example. /* CBSE 2008 */ 16. Differentiate between break and continue statements. 17. Difference between function definition and function prototype with an example. 18. How does a class enforce data hiding, abstraction and encapsulation? 19. While implementing encapsulation, abstraction is also implemented. Comment. 20. Reusability of classes is one of the major properties of OOP. How is it implemented in C++? /* CBSE 2001 */ 21. Define inheritance with example. Give two advantages of inheritance. 22. Illustrate the concept of function overloading with the help of an example. /*CBSE 2003, 2000, 2014*/ 23. What do you understand Polymorphism? Give an example illustrating its use in a C++ program. /* CBSE 2004 */ 24. What is the benefit of using default argument in a function? Give a suitable example to illustrate it using C++ code. /* CBSE 2013 */ 25. Name the Header file(s) that shall be needed for successful compilation of the following C++ code. (a) /*CBSE 2008 */ { char String[ ] = Peace ; cout << setw(2)<<string; (b) /*CBSE 2007 */ { char String[20]; gets(string); strcat(string, CBSE ); puts(string); Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

2 (c). typedef char STRING[80]; /*CBSE 2015 */ { STRING Txt[ ]= We love Peace ; int count=0; while (Txt[count]!= \0 ) if (isalpha(txt[count])) ; Txt[count++]= # ; puts[txt]; 26. Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. (a) include<iostream.h> /* CBSE 1998 */ { int R; W=90; while W>60 { R=W-50; switch(w) { 20:cout<< Lower Range <<endl; 30:cout<<.Middle Range.<<endl; 40:cout<<.Higher Range.<<endl; (b) struct Pixels { int Color, Style; void ShowPoint(Pixels P) { cout<<p.color, P.Style<<endl; { Pixels Point1=(5,3); ShowPoint(Point1); Pixels Point2=Point1; Color.Point1+=2; ShowPoint(Point2); (c) /* CBSE 2011 */ typedef char[80] String; { String S= Peace ; int L=strlen(S); cout<<s<< has <<L<< characters <<endl; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

3 (d) /* CBSE 2014 */ typedef char[80] STR; { Txt STR; gets(txt); cout<<txt[0]<< \t<<txt[2]; cout<<txt<<endline; (e) #Define float MaxSpeed=60.5; /* CBSE 2015 */ { int MySpeed char Alert= N ; cin>> MySpeed; if MySpeed> MaxSpeed Alert= Y ; cout<<alert<<endline; 27. Find the output of the following program: void change(int &N1,int &N2) { N1+=N2; N2+=N1; void main() { int Num1=25, Num2=20; cout<<"num 1="<<Num1--<< "Num 2 = "<<Num2 + 6<<endl; change(num1,num2); cout<<"num 2="<<++Num2<< "Num 1 = "<<Num1-5<<endl; change(num2,num1); cout<<"num 1="<<--Num2<< "Num 2 = "<<Num2--<<endl; 28. Find the output of the following program: /* CBSE 2000 */ int func(int &x,int y=10) { if(x%y==0) return ++x; return y--; { int p=20,q=23; q=func(p,q); cout<<p<<q<<endl; p=func(q); cout<<p<<q<<endl; q=func(p); cout<<p<<q<<endl; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

4 29. Find the output of the following program: int Calc(int U) { if (U%2==0) return U+10; return U+2; void pattern (char M,int B=2) { for(int CNT =0;CNT <B;CNT ++) cout << Calc (CNT)<<M; cout << endl; { pattern('*'); pattern('#',4); pattern('@',3); 30. Find the output of the following program: int a=3; void demo(int x, int y, int &z) { a+=x+y; z=a+y; y+=x; cout<<x<< <<y<< <<z<<endl; { int a=2,b=5; demo(::a,a,b); cout<<::a<< <<a<< <<b<<endl; demo(::a,a,b); 31. Find the output of the following program: /* CBSE 2015 */ void Location(int &X, int Y=4) { Y+=2; X+=Y; { int PX=10, PY=2; Location(PY); cout<<px<<, <<PY <<endl; Location(PX, PY); cout<<px<<, <<PY <<endl; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

5 32. Find the output of the following program: /* CBSE 2000 */ #include<ctype.h> { char *NAME= aprofile ; for(int x=0;x<strlen(name);x++) if(islower(name[x])) NAME[x]=toupper(NAME[x]); if(isupper(name[x])) if(x%2!=0) NAME[x]=tolower(NAME[x-1]); NAME[x]--; cout<<name<<endl; 33. Find the output of the following program: /* CBSE 2009 */ #include<ctype.h> void Encode(char Info[ ],int N); { char memo[ ]= Justnow ; Encode(memo, 2); cout<<memo<<endl; void Encode(char Info[ ],int N) { for(int I=0;Info[I]!= \0 ;I++) { if(i % 2 = = 0) Info[I]= Info[I] N; if (islower(info[i])) Info[I] = toupper (Info[I]); Info[I] = Info[I] + N; 34. Find the output of the following program: /* CBSE 2009 */ { int A[ ]={12,18,20, 35,40; int *p=a; while(*p<30) { if(*p%3!=0) *p=*p+5; *p=*p+2; p++; for(int j=0;j<=4;j++) { cout<<a[j]<<"*"; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

6 if(j%3==0) cout<<endl; cout<<a[4]*3<<endl; 35. Find the output of the following program: struct PLAY { int Score, Bonus; ; void Calculate(PLAY &P, int N=10) { P.Score++; P.Bonus+=N; void main() { PLAY PL={10,15; Calculate(PL,5); cout<<pl.score<< : <<PL.Bonus<<endl; Calculate(PL); cout<<pl.score<< : <<PL.Bonus<<endl; Calculate(PL,15); cout<<pl.score<< : <<PL.Bonus<<endl; 36. Find the output of the following program: /* CBSE 2010 */ struct THREE_D { int x,y,z; ; void movein(three_d &T, int step=1) { T.x+=step; T.y-=step; T.z+=step; void moveout(three_d &T, int step=1) { T.x-=step; T.y+=step; T.z-=step; { THREE_D T1={10,20,5,T2={30,10,40; movein(t1); moveout(t2,5); cout<<t1.x<<","<<t1.y<<","<<t1.z<<endl; cout<<t2.x<<","<<t2.y<<","<<t2.z<<endl; movein(t2,10); cout<<t2.x<<","<<t2.y<<","<<t2.z<<endl; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

7 37. Find the output of the following program: /* CBSE 2013 */ class Mausam { int City, Temp, Humidity; public: Mausam(int C=1) { City=C; Temp=10; Humidity=63; void Sun(int T) { Temp+=T; void Rain(int H) { Humidity +=H; void Checkout( ) { cout<<city<< : <<Temp<< & <<Humidity<< % <<endl; ; { Mausam M, N(2); M.Sun(5); M.Checkout( ); N.Rain(10); N.Sun(2); N.Checkout( ); M.Rain(15); M.Checkout( ); 38. In the following program, find the correct possible output(s) from the options if the value of VAL is 10 as input: #include<stdlib.h> void main() { randomize( ); int VAL, Rnd; int n=1; cin>>val; Rnd=8 + random(val) * 1; while(n<=rnd) { cout<<n<< \t ; n++; Output options: i) ii) iii) iv) Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

8 39. Observe the following program, and find out, which output out of (i) to (iv) will not be expected from the program? What will be the minimum and maximum value assigned to the variable Chance? /* CBSE 2012 */ #include <stdlib.h> void main() { randomize(); int Arr[ ]={9,6, N; int Chance=random(2)+10; for (int c=0; c<2; c++) { N=random(2); cout<<arr[n]+chance<< # ; a. 9#6# b. 19#17# c. 19#16# d. 20#16# 40. Study the following C++ code and find out the possible output or outputs out of the options (i) to (iv)? Also, write the minimum and maximum value, which can be assigned to the variable VAL. /* CBSE 2015 */ #include <stdlib.h> { randomize(); int VAL; VAL= random(3)+2; char Guess[ ]= ABCDEFGHIJK ; for (int I=1; I<=VAL; I++) { for (int J=VAL; J<=7; J++) cout<< Guess[J]; cout<<endl; (i) BCDEFGH (ii) CDEFGH (iii) EFGH (iv) FGHI BCDEFGH CDEFGH EFGH FGHI EFGH FGHI EFGH FGHI Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,

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

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

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

Sample Paper, 2015 Subject: Computer Science Class 12 th

Sample Paper, 2015 Subject: Computer Science Class 12 th Sample Paper, 2015 Subject: Computer Science Class 12 th Time: 3 Hours Max. Marks: 70 Instructions: i) All questions are compulsory and so attempt all. ii) Programming language: C++. iii) Please check

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

COMPUTER SCIENCE. Time allowed : 3 hours Maximum Marks : 70

COMPUTER SCIENCE. Time allowed : 3 hours Maximum Marks : 70 SET-4 Series SSO Code No. 91 Roll No. Candidates must write the Code on the title page of the answer-book. Please check that this question paper contains 20 printed pages. Code number given on the right

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

Write the names of the header files to which the following belong :

Write the names of the header files to which the following belong : Write the names of the header files to which the following belong : (i) puts( ) (ii) sin( ). What is the difference between call by value and call by reference? Give an example in C++ illustrate both.

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

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 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

b) #include<iostream.h> void main() { int a, b; cout<<"input two integer values? "; cin>>a>>b; double avg=(a+b)/2.0; cout<<"average="<<avg<<endl; }

b) #include<iostream.h> void main() { int a, b; cout<<input two integer values? ; cin>>a>>b; double avg=(a+b)/2.0; cout<<average=<<avg<<endl; } SAMPLEPAPER-2016 (Class 11) 1a)Name the header file(s) that shall be needed for successful compilation of the following C++ code. void main( ) char Name[20]; gets(name); int n=1+random(5); for(int k=0;k

More information

THE INDIAN COMMUNITY SCHOOL, KUWAIT

THE INDIAN COMMUNITY SCHOOL, KUWAIT THE INDIAN COMMUNITY SCHOOL, KUWAIT SERIES : I SE / 2016-2017 CODE : N 083 MAX. MARKS : 70 TIME ALLOWED : 3 HOURS NO. OF PAGES : 9 COMPUTER SCIENCE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

Mock Test Paper-2. CBSE XII : Computer Science. Duration : 3hrs Max Marks : 70

Mock Test Paper-2. CBSE XII : Computer Science. Duration : 3hrs Max Marks : 70 Mock Test Paper-2 CBSE XII : Computer Science Mock Test Paper-2 1 Duration : 3hrs Max Marks : 70 1. (a) What is the difference between Object Oriented Programming and Procedural programming? 2 (b) Write

More information

KENDRIYA VIDYALAYA PICKET : SECUNDERABAD :09 CLASS XII HOLIDAY HOME WORK

KENDRIYA VIDYALAYA PICKET : SECUNDERABAD :09 CLASS XII HOLIDAY HOME WORK KENDRIYA VIDYALAYA PICKET : SECUNDERABAD :09 CLASS XII HOLIDAY HOME WORK SUBJECT : MATHS SUBJECT :ACCOUNTANCY 1. Complete comprehensive project ( As discussed in the classroom). 2. Download 10 CBSE sample

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

(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

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

ITL Public School First Term( )

ITL Public School First Term( ) ITL Public School First Term(06-7) Date:9.09.6 Class: XI Computer Science(08) Time: hrs. M. M: 70 General Instructions: There are 7 questions in total. Marks are given against all the questions Try to

More information

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++] ASSIGNMENT-1 2016-17 CLASS-11 COMPUTER SCIENCE [C++] 1 Consider the following C++ snippet: int x = 25000; int y = 2*x; cout

More information

m) sin() n) endl o) getch() p) cout

m) sin() n) endl o) getch() p) cout SAMPLE PAPER 1. a) Name the header file for the following built-in functions: a) log() b) exp() c) getch() d) isalnum() e) fabs() f) isalpha() g) toupper() h) cos() i) random() j) gets() k) abs() l) tolower()

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

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

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

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

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

(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

KENDRIYA VIDYALAYA PANGODE MONTHLY TEST I JUNE 2015 CLASS XII COMPUTER SCIENCE Time allowed: 1 1/2 Hours Max. Marks: 50

KENDRIYA VIDYALAYA PANGODE MONTHLY TEST I JUNE 2015 CLASS XII COMPUTER SCIENCE Time allowed: 1 1/2 Hours Max. Marks: 50 KENDRIYA VIDYALAYA PANGODE MONTHLY TEST I JUNE 2015 CLASS XII COMPUTER SCIENCE Time allowed: 1 1/2 Hours Max. Marks: 50 General Instructions: 1. All questions are compulsory. 2. Marks for each question

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

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

Assignment-I. Date of Submission: (Computer Science)

Assignment-I. Date of Submission: (Computer Science) Assignment-I Date of Submission: 23-04-3013 (Computer Science) FIND THE OUTPUT OF FOLLOWING LINE OF CODE FROM QUESTION 1 TO 13 GENERAL /CALL BY VALUE AND CALL BY REFERENCE/SCOPE RESOLUTION Q 1 int f =

More information

case control statement (switch case)

case control statement (switch case) KEY POINTS: Introduction to C++ C++ is the successor of C language & developed by Bjarne Stroustrup at Bell Laboratories, New Jersey in 1979. Tokens- smallest individual unit. Following are the tokens

More information

include<iostream.h> #define PI=3.14 void main( ) { float r;a; cout<< enter any radius ; cin>>r; a=pi*pow(r,2); cout<< Area= <<a }

include<iostream.h> #define PI=3.14 void main( ) { float r;a; cout<< enter any radius ; cin>>r; a=pi*pow(r,2); cout<< Area= <<a } 1. Explain Gloabal and local variable with suitable example. 2. Difference between a runtime error and a syntax error. Give one example of each. 3. Difference between formal parameters and actual parameters.

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

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

CLASS-XI COMPUTER SCIENCE

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

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

Object Oriented Programming. Solved MCQs - Part 2

Object Oriented Programming. Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 It is possible to declare as a friend A member function A global function A class All of the above What

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

CSCE Practice Midterm. Data Types

CSCE Practice Midterm. Data Types CSCE 2004 - Practice Midterm This midterm exam was given in class several years ago. Work each of the following questions on your own. Once you are done, check your answers. For any questions whose answers

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

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

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

Downloaded from

Downloaded from Function: A function is a named unit of a group of statements that can be invoked from other parts of the program. The advantages of using functions are: Functions enable us to break a program down into

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

1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2)

1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2) THE AIR FORCE SCHOOL Class XI First Terminal Examination 2017-18 Computer Science (083) Time: 3 hrs. M. Marks : 70 General Instructions : (i) All the questions are compulsory. (ii) Programming Language

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

COMP 2355 Introduction to Systems Programming

COMP 2355 Introduction to Systems Programming COMP 2355 Introduction to Systems Programming Christian Grothoff christian@grothoff.org http://grothoff.org/christian/ 1 Today Templates Operator Overloading 2 Templates Syntactically similar to Java generics

More information

Guru Gobind Singh Public School Sector: V/B, Bokaro Steel City Assignment

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

More information

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. 1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. B. Outputs to the console a floating point number f1 in scientific format

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

خ ث ح 13:10 14:00 خ ث ح 51:51 16:11 ر ن 09:41 11:11 ر ن

خ ث ح 13:10 14:00 خ ث ح 51:51 16:11 ر ن 09:41 11:11 ر ن Philadelphia University Faculty of Engineering Department of Computer Engineering Programming Language (630263) Date:- 07/02/2015 Allowed time:- 2 Hours Final Exam Student Name: -... ID: - Instructor:

More information

CSCE Practice Midterm. Data Types

CSCE Practice Midterm. Data Types CSCE 2004 - Practice Midterm This midterm exam was given in class several years ago. Work each of the following questions on your own. Once you are done, check your answers. For any questions whose answers

More information

Programming in C++: Assignment Week 2

Programming in C++: Assignment Week 2 Programming in C++: Assignment Week 2 Total Marks : 20 Each question carries one mark Right hand side of each question shows its Type (MCQ/MSQ) March 3, 2017 Question 1 Look at the code snippet below:

More information

Consider the following statements. string str1 = "ABCDEFGHIJKLM"; string str2; After the statement str2 = str1.substr(1,4); executes, the value of str2 is " ". Given the function prototype: float test(int,

More information

SECTION A [Only for candidates, who opted for C++]

SECTION A [Only for candidates, who opted for C++] PRINCE PUBLIC SCHOOL HALF YEARLY EXAMINATION (2018-19) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS MAXIMUM MARKS: 70 General Instructions 1. This question paper conations 4 questions. 2.

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

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

else Txt[Count++]= # puts (Txt) A) ctype.h, stdio.h

else Txt[Count++]= # puts (Txt) A) ctype.h, stdio.h Txt[Count++]= @ Txt[Count++]= # puts (Txt) A) ctype.h, stdio.h (05 OD) 4) Observe the following C++ code and write the name(s) of the header file(s), which will be essentially required to run it in a C++

More information

16. What is the significance of the break statement in a switch block?

16. What is the significance of the break statement in a switch block? Section A : Question carrying 1 Mark 01. How is data different from information? 02. Arrange the following in descending order :- Nibble, KB, Bit, GB,TB,Byte,MB 03. What is the significance of task bar

More information

CHAPTER-1 C++ REVISION TOUR VERY SHORT/ SHORT ANSWER QUESTIONS

CHAPTER-1 C++ REVISION TOUR VERY SHORT/ SHORT ANSWER QUESTIONS CHAPTER-1 C++ REVISION TOUR VERY SHORT/ SHORT ANSWER QUESTIONS 1. Find out the errors, if any, in the following C++ statement: (i) cout

More information

Fast Introduction to Object Oriented Programming and C++

Fast Introduction to Object Oriented Programming and C++ Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming

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

Somany Vidyapeeth, Masani, Rewari

Somany Vidyapeeth, Masani, Rewari Somany Vidyapeeth, Masani, Rewari Summer Holiday Homework (2016-17) Subject: English Revise syllabus done in class. Read Novel Invisibal man and write a Book review and prepare book cover. Solve the given

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

3. Functions. Modular programming is the dividing of the entire problem into small sub problems that can be solved by writing separate programs.

3. Functions. Modular programming is the dividing of the entire problem into small sub problems that can be solved by writing separate programs. 1 3. Functions 1. What are the merits and demerits of modular programming? Modular programming is the dividing of the entire problem into small sub problems that can be solved by writing separate programs.

More information

Sample Paper COMPUTER SCIENCE (Theory) Class-XII Time Allowed: 3hours Maximum Marks: 70

Sample Paper COMPUTER SCIENCE (Theory) Class-XII Time Allowed: 3hours Maximum Marks: 70 Sample Paper- 2015 COMPUTER SCIENCE (Theory) Class-XII Time Allowed: 3hours Maximum Marks: 70 Note. (i) All questions are compulsory. (ii) Programming Language: C+ + Ques. 1 a) What is the use of inline

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

SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION MAX MARKS:70 CODE - A DURATION : 3 Hours

SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION MAX MARKS:70 CODE - A DURATION : 3 Hours SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION 2016 MAX MARKS:70 CODE - A DURATION : 3 Hours All questions are compulsory. Do not change the order of the questions

More information

Dr. Md. Humayun Kabir CSE Department, BUET

Dr. Md. Humayun Kabir CSE Department, BUET C++ Dr. Md. Humayun Kabir CSE Department, BUET History of C++ Invented by Bjarne Stroustrup at Bell Lab in 1979 Initially known as C with Classes Classes and Basic Inheritance The name was changed to C++

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

KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION FOR CLASS XII SUBJECT: COMPUTER SCIENCE

KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION FOR CLASS XII SUBJECT: COMPUTER SCIENCE KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION 2014-15 FOR CLASS XII SUBJECT: COMPUTER SCIENCE SET-I F.M. 70 General Instructions: Programming Language C++ All Questions are

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

K.V. NO 1 ARMAPUR Computer Science- XII Summer Vacation Home Assignment

K.V. NO 1 ARMAPUR Computer Science- XII Summer Vacation Home Assignment K.V. NO 1 ARMAPUR Computer Science- XII Summer Vacation Home Assignment-2016-17 By- Computer Science Home Assignment 2016-17 Created By-S.K.Verma, PGT CS HOME ASSIGNMENT FOR SUMMER VACATION 2016-17 FIRST

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

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

Downloaded from

Downloaded from CBSE PREVIOUS YEAR QUESTION BANK QNO 1 (a) 1 (a) Define the following terms: 2 (i) Inheritance (ii) Encapsulation 1998 Delhi Board 1(a) Differentiate between a Run Time Error and Syntax Error. Also give

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

Guru Gobind Singh Public School Sector : V/B, Bokaro Steel City

Guru Gobind Singh Public School Sector : V/B, Bokaro Steel City Guru Gobind Singh Public School Sector : V/B, Bokaro Steel City 1. a) Write the types of tokens(keywords and user identifiers) from the following : i) case ii) _delete iii) WHILE iv) 21stName b) Which

More information

Module Operator Overloading and Type Conversion. Table of Contents

Module Operator Overloading and Type Conversion. Table of Contents 1 Module - 33 Operator Overloading and Type Conversion Table of Contents 1. Introduction 2. Operator Overloading 3. this pointer 4. Overloading Unary Operators 5. Overloading Binary Operators 6. Overloading

More information

Using Parallel Arrays. Parallel Array Example

Using Parallel Arrays. Parallel Array Example Using Parallel Arrays Parallel arrays: two or more arrays that contain related data A subscript is used to relate arrays: elements at same subscript are related Arrays may be of different types Parallel

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli COMS W3101 Programming Language: C++ (Fall 2015) ramana@cs.columbia.edu Lecture-2 Overview of C continued C character arrays Functions Structures Pointers C++ string class C++ Design, difference with C

More information

b) Give the output of the following program: 6,70,70 2,70 210,282,59290

b) Give the output of the following program: 6,70,70 2,70 210,282,59290 Set II 1. a) Name the header file for the following built-in functions: i) fabs() math.h ii) isalpha() ctype.h iii) toupper() ctype.h iv) cos() math.h b) Give the output of the following program: 6,70,70

More information

A SHORT COURSE ON C++

A SHORT COURSE ON C++ Introduction to A SHORT COURSE ON School of Mathematics Semester 1 2008 Introduction to OUTLINE 1 INTRODUCTION TO 2 FLOW CONTROL AND FUNCTIONS If Else Looping Functions Cmath Library Prototyping Introduction

More information

Chapter 1. Computer Overview

Chapter 1. Computer Overview DELHI PUBLIC SCHOOL, Durgapur QUESTION BANK of computer science FOR block test-i examination (2018-19) CLASS-XI Chapter 1. Computer Overview 1. What is data? What is information? 2. Name the subunits of

More information

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli COMS W3101 Programming Language: C++ (Fall 2015) ramana@cs.columbia.edu Lecture-2 Overview of C continued C character arrays Functions Structures Pointers C++ string class C++ Design, difference with C

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

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

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

C++ PROGRAMMING SKILLS Part 3 User-Defined Functions

C++ PROGRAMMING SKILLS Part 3 User-Defined Functions C++ PROGRAMMING SKILLS Part 3 User-Defined Functions Introduction Function Definition Void function Global Vs Local variables Random Number Generator Recursion Function Overloading Sample Code 1 Functions

More information

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW IMPORTANT QUESTIONS IN C FOR THE INTERVIEW 1. What is a header file? Header file is a simple text file which contains prototypes of all in-built functions, predefined variables and symbolic constants.

More information

Chapter 2. Procedural Programming

Chapter 2. Procedural Programming Chapter 2 Procedural Programming 2: Preview Basic concepts that are similar in both Java and C++, including: standard data types control structures I/O functions Dynamic memory management, and some basic

More information

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each. I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK 70. a) What is the difference between Hardware and Software? Give one example for each. b) Give two differences between primary and secondary memory.

More information

COMS W3101 Programming Language: C++ (Fall 2016) Ramana Isukapalli

COMS W3101 Programming Language: C++ (Fall 2016) Ramana Isukapalli COMS W3101 Programming Language: C++ (Fall 2016) ramana@cs.columbia.edu Lecture-2 Overview of C C++ Functions Structures Pointers Design, difference with C Concepts of Object oriented Programming Concept

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

Chapter 15 - C++ As A "Better C"

Chapter 15 - C++ As A Better C Chapter 15 - C++ As A "Better C" Outline 15.1 Introduction 15.2 C++ 15.3 A Simple Program: Adding Two Integers 15.4 C++ Standard Library 15.5 Header Files 15.6 Inline Functions 15.7 References and Reference

More information

Inheritance and Overloading. Week 11

Inheritance and Overloading. Week 11 Inheritance and Overloading Week 11 1 Inheritance Objects are often defined in terms of hierarchical classes with a base class and one or more levels of classes that inherit from the classes that are above

More information