THE INDIAN COMMUNITY SCHOOL, KUWAIT

Similar documents
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 }

ASSIGNMENTS FOR CLASS XII :

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

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:

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION

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

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

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

AISSCE COMMON MODEL EXAMINATION Subject Computer Science [083] Time Allotted: 3 Hours Maximum Marks: 70

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

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

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

Model Sample Paper 2015

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

CLASS-XI COMPUTER SCIENCE

2009 (Class XII) Solved Paper. Time allowed : 3 hours Maximum Marks : 100

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

KendriyaVidyalayaSangathan Kolkata Region

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

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

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

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

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE

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

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

C++ 8. Constructors and Destructors

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

SAMPLE PAPER 2015 SUB - COMPUTER SCIENCE - (Theory) CLASS XII Time allowed: 3 hours Maximum marks: 70

vinodsrivastava.com Constructor and Destructor

Sample Paper, 2015 Subject: Computer Science Class 12 th

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

(i) case (ii) _delete (iii) WHILE (iv) 21stName

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

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

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

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

Computer Science 2006 (Outside Delhi)

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION

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

Class XII Computer Science (083) Sample Question Paper Time allowed: 3 Hours Max. Marks: 70

COMPUTER SCIENCE

COMPUTER SCIENCE (083)

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

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

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

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

CLASS XII GUESS PAPER COMPUTER SCENCE (083)

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

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

Short Notes of CS201

QUESTION BANK SUB: COMPUTER SCIENCE(083)

CS201 - Introduction to Programming Glossary By

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION SECOND PRE BOARD EXAMINATION CLASS XII

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

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

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

(d) Rewrite the following program after removing all the syntax error(s), if any. [2] include <iostream.h> void main ( )

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

Computer Science 2006 (Delhi)

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

COMPUTER SCIENCE Time allowed : 3hours] [Maximum Marks :70

COMMON PRE-BOARD EXAMINATION COMPUTER SCIENCE

2016 COMPUTER SCIENCE

Functions. Introduction :

KE DRIYA VIDYALAYA SA GATHA CHE AI REGIO COMMO PREBOARD EXAMI ATIO COMPUTER SCIE CE

SAMPLE QUESTION PAPER CLASS-XII, SESSION: SUBJECT: COMPUTER SCIENCE

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST PRE-BOARD EXAMINATION COMPUTER SCIENCE

Sample Paper, Subject: Computer Science Class 12 th Time Allowed : 3 Hr. M.M.: 70

Session Chapter 4: Classess & Object

KENDRIYA VIDYALAYA IIT CAMPUS CHENNAI 36 COMPUTER SCIENCE. Half Yearly

EAS 230 Fall 2002 Section B

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

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

COMPUTER SCIENCE (083)

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

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

Sample Paper Class XI Subject Computer Sience UNIT TEST II

COMPUTER SCIENCE 1998 (Delhi Board)

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

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:

Object Oriented Programming. Solved MCQs - Part 2

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

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

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


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

Sample Paper 2012 Class XII Subject Computer Science

CS201 Latest Solved MCQs

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

Computer Science XII Important Concepts for CBSE Examination Questions

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

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

KENDRIYA VIDYALYA CLRI CHENNAI AUTUMN BREAK HOLIDAY HW MARKS QUESTIONS : DATA STRUCTURE

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

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

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

Question Bank Class XII Subject : Computer Science

Transcription:

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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note: All questions are compulsory Read the questions carefully 1. a. Define Macro with suitable example. b. Rani has started learning C++ and has typed the following program. When she compiled the (1) following code written by her, she discovered that she needs to include some header files to successfully compile and execute it. Write the names of those header files, which are required to be included in the code. float A,Number,Outcome; cin>>a>>number; Outcome=pow(A,Number); cout<<outcome<<endl; c. Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined. Note: Assume all required header files are already being included in the program. #define Formula(a,b) = 2*a+b float X=3.2;Y=4.1; Z=Formula(X,Y); cout<< Result= <<Z<<endl; d. Find and write the output of the following C++ program code: Note: Assume all required header files are already included in the program. typedef char STRING[80]; void MIXITNOW(STRING S) int Size=strlen(S); for (int I=0;I<Size1;I+= 2) char WS=S[I]; S[I]=S[I+1]; S[I+1]=WS; for (I=1;I<Size;I+=2) if (S[I]>= M && S[I]<= U ) S[I]= @ ; STRING Word= CRACKAJACK ; MIXITNOW(Word); cout<<word<<endl; 1

e. Find and write the output of the following C++ program code: Note: Assume all required header files are already being included in the program. class Share long int Code; float Rate; int DD; Share()Code=1000;Rate=100;DD=1; void GetCode(long int C,float R) Code=C; Rate=R; void Update(int Change,int D) Rate+=Change; DD=D; void Status() cout<< Date: <<DD<<endl; cout<<code<< # <<Rate<<endl; ; Share S,T,U; S.GetCode(1324,350); T.GetCode(1435,250); S.Update(50,28); U.Update(25,26) ; S.Status(); T.Status(); U.Status(); 2

f. Study the following program and select the possible output(s) from the options (i) to (iv) following it. Also, write the maximum and the minimum values that can be assigned to the variable NVM. Note: Assume all required header files are already being included in the program. random(n) function generates an integer between 0 and n - 1. randomize(); int NOM; NOM=random+2; char TEXT[]="ABCDEFGHIJK"; for (int I=1;I<=NOM; I++) for(int J=NUM; J<=7iJ++) cout<<text[j]; cout<<end1; (i) FGHI FGHI FGHI FGHI (ii) BCDEFGH BCDEFGH (iii) EFGH EFGH EFGH EFGH (iv) CDEFGH CDEFGH g. Find the output of the following Program: #include<iostream.h> 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; void main( ) 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; 2. a. What is a copy constructor? Give a suitable example in C++ to illustrate with its definition within a class and a declaration of an object with the help of it. 3

b. Write any four important characteristics of Object Oriented Programming? Give example of any one of the characteristics using C++. c. Rewrite the following program after removing the syntactical error(s)(if any). Underline each correction. #include<iostream.h> class Transport char Model[20]; char Name[20]; void Get( ) gets(model); gets(name); void Show( ) cout<<model<<endl; puts(name); ; void main( ) Transport T; Get.T( ); Show( ); d. Define a class RESORT in C++ with following description : Private Members : Rno //Data member to store Room No. Name //Data member to store customer name. Charges //Data member to store per day charges. Days //Data member to store number of days of stay. COMPUTE()//A function to calculate and return Amount as Days*Charges and if the value of Day*Charges is more than 11000 then as 1.02*Days*Charges Public Members Getinfo() //A function to enter the content Rno, Name,Charges and Days Dispinfo() //A function to display Rno, Name, Charges,Days and Amount (Amount to be displayed by calling function COMPUTE()) e. Answer the questions (i) and (ii) after going through the following class: class WORK int WorkId; char WorkType; ~WORK() //Function 1 cout<< Un-Allocated <<endl; void status() //Function 2 cout<<workid<< : <<Work Type<<endl; WORK() //Function 3 WorkId=10 ; WorkType= T ; WORK(WORK & W) //Function 4 WorkId=W.WorkId+12; Work Type=W.WorkType+1 ; 4

(i) Which member function out of Function 1, Function 2, Function 3 and Function 4 shown in the above definition of class WORK is called automatically, when the Scope of an object gets over? Is it known as Constructor OR Destructor OR Overloaded Function OR Copy Constructor? (ii) WORK W; //Statement 1 WORK Y (W); //Statement 2 Which member function out of Function 1, Function 2, Function 3 and Function 4 shown in the above definition of class WORK is called on execution of statement 2? What is it specifically called Destructor, Copy constructor, parameterized constructor or default constructor. 3. a. Answer the questions (i) to (iv) based on the following : class Regular char School Code [10]; public : void InRegular(); void outregular(); ; class Distance char StudyCentreCode[5]; public : void Indistance ( ); void OutDistance ( ); ; class Course: public Regular, private Distance char Code[5]; float Fees ; int Duration; void InCourse (); void Out Course (); ; (i) Which type of Inheritance is shown in the above example? (ii) Write names of all the member functions accessible from OutCourse function of class Course. (iii) Write name of all the members accessible through an object of class Course. (iv) Is the function InRegular() accessible inside the function InDistance()? Justify your answer. b. Answer the questions (i) to (iv) based on the following : class Toys char TCode[5]; protected: float Prince; void Assign(float) ; Toys(); void TEntry(); void TDisplay(); ; class SoftToys : public Toys char STname[20]; float Weight; SoftToys(); 5

Void STEntry(); Void STDisplay(); ; Class ElectronicToys : public Toys char ETname[20]; int No_of_Batteries; Public: Electronic Toys(); Void ETEntry(); Void ETDisplay(); ; (i) (ii) (iii) Which type of inheritance is shown in the above example? How many bytes will be required by an object of the class SoftToys? Write name of all the data members accessible from member functions of the class SoftToys. (iv)write name of all the member functions which are accessible from an object of the class Electronic Toys. 4. a. Find the output of the following program : #include<iostream.h> int X[] = 10, 25, 30, 55, 110; int *p = X; while (*p < 110) if (*p%3!= 0) *p = *p + 1; else *p = *p + 2; p++; for (int I = 4; I>=1 ; 1 I ) cout<<x [I] << * ; if (I%3 == 0) cout<<endl; cout<<x [0] * 3<<endl; b. In the following program,what will be the possible output(s) from the following options (i),(ii),(iii) and (iv)?justify your answer. #include<iostream.h> #include<stdlib.h> #include<string.h> #include<conio.h> clrscr(); char *Text= 1234 ; int L=strlen(Text); randomize (); for(int I=0;I<L;I++) int start=random(i)+1; Char p=text[start]; 6

Cout<<P<< : ; getch(); (i)1:3:2:4 (iii)2:2:3:2 (ii)2:2:3:2 (iv)2:2:2:3 5. a. Write function definition for WORD4CHAR() in C++ to read the content of a text file FUN.TXT, and display all those words, which has four characters in it. Example: If the content of the file fun.txt is as follows: When I was a small child, I used to play in the garden with my grand mom. Those days were amazingly funful and I remember all the moments of that time The function WORD4CHAR() should display the following: When used play with days were that time b. Write a definition for function Economic ( ) in C++ to read each record of a binary file ITEMS.DAT, find and display those items, which costs less than 2500. Assume that the file ITEMS.DAT is created with the help of objects of class ITEMS, which is defined below: class ITEMS int ID;char GIFT[20]; float Cost; public : void Get () cin>>code;gets(gift);cin>>cost; void See () cout<<id<<":"<<gift<<":"<<cost<<end1; float GetCost() return Cost;. ; c. Observe the program segment given below carefully and fill the blanks marked as Line 1 and Line 2 using fstream functions for performing the required task. #include <fstream.h> class Stock long Ino; //Item Number char Item [20];//Item Name int Qty; //Quantity void Get(int); //Function to enter the content void show(); //Function to display the content void Purchase (int Tqty) Qty+=Tqty; //Function to increment in Qty long KnowIno () return Ino; ; void Purchaseitem (long PINo, int PQty) //PINo > Ino of the item purchased //PQty > Number of item purchased fstream File; File. open ( STOCK.DAT, ios: : 7

binary ios: : in ios: : out); int Position= 1; Liberary L; while (Position = = 1 && File. read ((char * ) &L, sizeof (L))) if (L. GetAno() = =BANo) L. Buy (BQty); //To update the number of Books Positions=File. tellg() sizeof (L); //Line 1: To place the file pointer to the required position. ; //Line 2: To write the object L on to the binary file ; if (Position== 1) cout<< No updation done as required Ano not found... ; File. Close(); 6. a. Write the definition of a function FixPay(float Pay[], int N) in C++, which should modify each element of the array Pay having N elements, as per the following rules: b. Write a COLSUM function in C++ to find sum of each column of a N * M matrix. c. A two dimensional array P[20] [50] is stored in the memory along the row with each of its element occupying 4 bytes, find the address of the element P[10] [30], if the element P[5] [5] is stored at the memory location 15000. d. Convert the following infix expression to its equivalent Postfix expression, showing the stack contents for each step of conversion. X / Y + U* (V-W) e. Evaluate the following Postfix notation of expression showing the stack contents for each step of conversion. FALSE,NOT,True,AND,True,False,OR,AND f. Write the definition of a member function INSERT() for a class QUEUE in C++, to insert an ITEM in a dynamically allocated Queue of items considering the following code is already written as a part of the program. struct ITEM int INO; char INAME[20]; ITEM *Link; ; class QUEUE ITEM *R, *F; QUEUE()R=NULL;F=NULL; void INSERT(); void DELETE(); ~QUEUE(); ; 8

g. Write a function in C++ to delete a node containing Book s information, from a dynamically allocated stack of Books implemented with the help of the following structure. struct Book int BNO; char BName[20]; Book *Next; ; 9