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

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

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

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

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

Class and object Holiday Homework

KendriyaVidyalayaSangathan Kolkata Region

91/1 COMPUTER SCIENCE. Series SHC/1. dksm ua- jksy ua- Code No. Roll No. Candidates must write the Code on the title page of the answer-book.

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

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

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

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

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

Government Polytechnic, Muzaffarpur. Name of the Lab: OBJECT ORIENTED PROGRAMMING

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

Sample Paper Class XI Subject Computer Sience UNIT TEST II

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

C++ 8. Constructors and Destructors

Object Oriented Pragramming (22316)

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

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

COMPUTER SCIENCE (CODE 083) CLASS XII Time allowed : 3Hours Maximum. Marks 70

Darshan Institute of Engineering & Technology for Diploma Studies

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

Multiple Choice (Questions 1 14) 28 Points Select all correct answers (multiple correct answers are possible)

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

Object Oriented Programming. Solved MCQs - Part 2

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

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

Downloaded from

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

Series SHC COMPUTER SCIENCE. Code No. 91. Roll No.

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms.

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

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

Module 1. C++ Classes Exercises

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

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:

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


DELHI PUBLIC SCHOOL TAPI

UNIT- 3 Introduction to C++

Polymorphism. Zimmer CSCI 330

Functions. Introduction :

Name SECTION: 12:45 2:20. True or False (12 Points)

ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE

Multiple Choice (Questions 1 14) 28 Points Select all correct answers (multiple correct answers are possible)

FORM 2 (Please put your name and form # on the scantron!!!!)

CHAPTER 4 FUNCTIONS. 4.1 Introduction

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE

CSE202-Lec#4. CSE202 C++ Programming

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

COMPUTER SCIENCE (083)

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

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition)

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

COMPUTER SCIENCE (083)

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1

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

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING REWRAP TEST I CS6301 PROGRAMMING DATA STRUCTURES II

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

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

KENDRIYA VIDYALAYA SANGATHAN, GUWAHATI REGION HALF-YEARLY EXAMINATION-2015 CLASS XI : COMPUTER SCIENCE Time Allotted : 3 hrs. Max.


Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

Constructor & Classes Questions

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

KE DRIYA VIDYALAYA SA GATHA,CHE AI REGIO. COMMO PRE-BOARD EXAMI ATIO COMPUTER SCIE CE CLASS- XII Time allowed : 3 hours Maximum Marks : 70

Padasalai.Net s Model Question Paper

STRUCTURED DATA TYPE ARRAYS IN C++ ONE-DIMENSIONAL ARRAY TWO-DIMENSIONAL ARRAY

vinodsrivastava.com Constructor and Destructor

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

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

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

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

C++_ MARKS 40 MIN

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

2015 Academic Challenge

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

CPE 112 Spring 2015 Exam II (100 pts) March 4, Definition Matching (8 Points)

CS32 - Week 4. Umut Oztok. Jul 15, Umut Oztok CS32 - Week 4

Passing arguments to functions by. const member functions const arguments to a function. Function overloading and overriding Templates

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

Downloaded from

CS 376b Computer Vision

Some important concept in oops are 1) Classes 2) Objects 3) Data abstraction & Encapsulation. 4) Inheritance 5) Dynamic binding. 6) Message passing

A SHORT COURSE ON C++

COMMON QUARTERLY EXAMINATION SEPTEMBER 2018

CPE Summer 2015 Exam I (150 pts) June 18, 2015

cout<< \n Enter values for a and b... ; cin>>a>>b;

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

COMPUTER SCIENCE 1998 (Delhi Board)

We can even use the operator << to chain the output request as:

Sample Final Exam. 1) (24 points) Show what is printed by the following segments of code (assume all appropriate header files, etc.

#include<iostream.h> { for(int L=1;L<=N;L++) cout<<m*l; cout<<endl; } void main()

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.

FORM 1 (Please put your name and form # on the scantron!!!!) CS 161 Exam I: True (A)/False(B) (2 pts each):

5. Assuming gooddata is a Boolean variable, the following two tests are logically equivalent. if (gooddata == false) if (!

Padasalai.Net Half Yearly Exam Model Question Paper

Transcription:

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 by a single space. 2. Write a program to count the occurrence of each digit, white spaces, char (blank, tab, newline) & all other characters in a given string. 3. Write a program to search an entered character in the string. 4. Write a program to check whether the given string is palindrome or not. 5. Write a program to check whether the entered two strings are equal or not. 6. Write a program to convert a given the given string into Upper case &Lower case 7. Write a program to search an entered word in a given string. 8. Write a program to eliminate the extra spaces from a given string. 9. Write a program to convert ; into, in a given string. 10. Write a program to enter a string and count the number of Upper case, Lower case and special characters. 11. Write a program to enter a string and count the number of blank spaces. 12. Write a program to enter a string and print every word in a new line. 13. Write a program to enter integers into 2D array (3X3) and display the array s mirror image. 14. Write a program to enter n integers into an array of integers and multiply all even position s number by 2 and all odd position s integers by 3 and display the result(note :-array starting from index number 0). 15. Write a program to use define directive in program. 16. Write a program to perform sum of upper and lower diagonal elements given below: 0 1 2 0 1 2 3 4 5 3 4 5 6 7 8 6 7 8 17. Write a program to double every element of a 2D array of integers. 18. Write a program to print all the elements of 2D array except diagonal elements. 19. Write a program to exchange first row and last row of a 2D array of integers. 20. Write a program to display each row s characters of a 2D string in reverse order. 21. Write a program to find the frequency of a person s name in a 2D string array. ----------------------------------------------------------------------------------------- 22. Name the Header file(s) that shall be needed for successful compilation of the following C++ code int a[10]; for (int i=0;i<10;i++) cin>>a[i]; if(a[i]%2==0) a[i]=pow(a[i],3); else a[i]=sqrt(a[i]); if(a[i]>32767) exit(0); getch(); 23. Name the header files that shall be needed for the following void main( ) char String[ ] = Peace ; cout << setw(2)<<string; Find the output of the following program :

#include<iostream.h> struct MyBox int length, breadth, height; ; void Dimension(MyBox M) cout<<m.length<< x <<M.breadth<< x <<M.height; MyBox B1=10,15,5,B2,B3; ++B1.height; Dimension(B1); B3=B1; ++B3.lenght; B3.breadth++; Dimension(B3); B2=B3; B2.height+=5; B2.lenght--; Dimension(B2); 24. Find the correct possible output from the option: #include<stdlib.h> #include<iostream.h> Randomize(); Char Area[][10]= North, South, East, West ; int ToGo; for(int i=0;i<3;;i++) ToGo=random(2)+1; Cout<<Area[ToGo]<< : ; Outputs: South : East : South : North : South : East : South : East : West: South : East : East : 25. Suppose a class is defined as follows answer the following questions below: class animal Private: char name[15]; int legs; Public: animal(int l) leg=l; Void input() cin>>name>>legs; animal() cout<< Animal ; ~animal() cout<<~animal int num_of_legs() i. What features of OOPS are implemented in the program? ii. Write statement to execute constructor and destructor of the program

; return legs; 26. Define a class serial in C++ with the following specifications: Private members of class serial Serialcode integer Title 20 character Duration float Noofepisodes integer Public member function of class serial A constructor to initialize duration as 30 and noofepisodes as 10. Newserial() function to accept values for Serialcode and Title. Otherentries () function to assign the values of Duration and Noofepisodes with the help of corresponding values passed as parameters to this function. Dispdata() function to display all the data members on the screen. --------------------------------------------------------------------------------------------------- OBJECT ORIENTED PROGRAMMING 27. What is abstraction? 28. How is data hiding implemented in C++? 29. What is polymorphism? How does function overloading implement polymorphism? 30. What is Function Overloading? Explain with example. 31. What do you mean by Data Encapsulation, Inheritance? 32. Define Class and Object. 33. Differentiate between Object based programming and Object Oriented programming. 34. Enlist some advantages of OOP CLASSES AND OBJECTS 35. Define a class TravelPlan in C++ with the following descriptions: Private Members: PlanCode of type long Place of type character array (string) Number_of_travellers of type integer Number_of_buses of type integer Public Members: A constructor to assign initial values of Plan Code as 1001, Place as Agra, Number_of_travellers as 5, Number_of_buses as 1 A function NewPlan( ) which allows user to enter PlanCode, Place and Number_of_travellers. Also, assign the value of Number_of_buses as per the following conditions : Number_of_travellers Number_of_buses Less than 20 1 Equal to or more than 20 and less than 40 2 Equal to 40 or more than 40 3 A function ShowPlan( ) to display the content of all the data members on screen. 36. Define a class Tour in C++ with the description given below : Private Members : TCode of type string NoofAdults of type integer NoofKids of type integer Kilometres of type integer TotalFare of type float Public Members : A constructor to assign initial values as follows : TCode with the word NULL

NoofAdults as 0 NoofKids as 0 Kilometres as 0 TotalFare as 0 A function AssignFare () which calculates and assigns the value of the data member TotalFare as follows For each Adult Fare(Rs) For Kilometres 500 >=1000 300 <1000 & >=500 200 <500 For each Kid the above Fare will be 50% of the Fare mentioned in the above table For example : If Kilometres is 850, NoofAdults = 2 and NoofKids = 3 Then TotalFare should be calculated as NumofAdults * 300 + NoofKids * 150 i.e. 2*300 + 3*150=1050 A function EnterTour( ) to input the values of the data members TCode, NoofAdults, NoofKids and Kilometres; and invoke the Assign Fare( ) function. A function ShowTour( ) which displays the content of all the data members for a Tour. FIND-OUTPUT 37. #include <iostream.h> struct Game int Score, Bonus;; void Calculate(Game &P, int N = 10) P.Score++; P.Bonus+=N; Game PL=7, 12; 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; 38. #include<iostream.h> int i = 20; void abc () static int i = 4; i = i + 4; cout << "first = " << i; void main( ) int i = 2;abc( ); cout << " second = " << i << endl; abc(); cout << " Third = " << ::i << endl; 39. #include<stdlib.h> #include<iostream.h> randomize(); int Num, Rndnum; cin >> Num; Rndnum = random(num) + 5; for (int N = 1; N<=Rndnum-1; N++) cout << N << ""; 40. #include <iostream.h> // Function prototype for general function void try(); class abc

int x; public: // Class member function void try() cout << "Hello"; ; // Function body of general function void try() cout << "How are you?"; abc A; A.try(); try(); 41. #include <iostream.h> #include <conio.h> int Function(int p) if(p == 1 p == 0) return 1; if(p%2 == 0) return Function(p / 2) + 4; else return Function(p - 1) + 5; clrscr(); int A = Function(6); cout << A; 42. #include<iostream.h> void Execute(int &B, int C = 100) int TEMP = B+C; B += TEMP; if(c!= 200) cout << TEMP << B << C << endl; int M = 90, N = 10; Execute(M); cout << M << N << endl; Execute(M, N); cout << M << N << endl; 43. #include<stdio.h> #include<iostream.h> int s1,s2, num; s1 = s2 = 0; for(int x=0; x<11; x++) cin >> num; if (num > 0) s1 += num; else s2 /= num; cout<<s1<<s2; 44. #include<iostream.h> int func(int &x, int y = 10) if ( x % y == 0) return ++x; else 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; 45. # include<iostream.h> main() int x, sum = 0; int n; cin >> n; for (x = 1; x < 100; x+=2) if( x%2 == 0) sum += x; cout << "SUM = " << sum; 46. #include <iostream.h> int max(int &x, int &y, int &z) if (x > y && y > z) y++; z++; return x; else if (y > x) return y; else return z; int a = 10, b = 13, c = 8; a = max(a, b, c); cout << a << b << c << endl; b = max(a, b, c); cout << ++a << ++b << ++c << endl; c = max(a, b, c); cout << a++ << ++b << +++c << endl;