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

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

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

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

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

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

Short Notes of CS201

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

CS201 - Introduction to Programming Glossary By

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

CS201 Latest Solved MCQs

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

COMMON PRE-BOARD EXAMINATION COMPUTER SCIENCE

Computer Science 2006 (Outside Delhi)

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

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

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

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

Question Bank Class XII Subject : Computer Science

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

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

VALLIAMMAI ENGINEERING COLLEGE

Computer Science XII Important Concepts for CBSE Examination Questions

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

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

Come and join us at WebLyceum

Autumn Break 2017 Exam Oriented Assignment Class-XII B, Computer Science

CLASS XII GUESS PAPER COMPUTER SCENCE (083)

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

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

COMPUTER SCIENCE

COMMON PRE-BOARD EXAMINATION COMPUTER SCIENCE

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

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

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE

A506 / C201 Computer Programming II Placement Exam Sample Questions. For each of the following, choose the most appropriate answer (2pts each).

Sample Paper Class XI Subject Computer Sience UNIT TEST II

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

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

KendriyaVidyalayaSangathan Kolkata Region

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

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

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

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

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

THE INDIAN COMMUNITY SCHOOL, KUWAIT

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

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

CS Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2015

SPLIT-UP SYLLABUS ----CHENNAI REGION COMPUTER SCIENCE (Code: 083) Class-XII Academic Session

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

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

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

Object Oriented Pragramming (22316)

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

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

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

C++ Structures Programming Workshop 2 (CSCI 1061U)

Downloaded from

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive)

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

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

cout << "How many numbers would you like to type? "; cin >> memsize; p = new int[memsize];

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

Computer Science 2006 (Delhi)

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

Operators in C. Staff Incharge: S.Sasirekha

Assignment 3 Class XII (Computer Science 083) Topic Array

List of Practical for Class XII Computer Science

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

8. Functions (II) Control Structures: Arguments passed by value and by reference int x=5, y=3, z; z = addition ( x, y );

CS201- Introduction to Programming Current Quizzes

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

SAURASHTRA UNIVERSITY

Starting Savitch Chapter 10. A class is a data type whose variables are objects. Some pre-defined classes in C++ include int,

Object Oriented Programming. Solved MCQs - Part 2

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

Sample Paper, 2015 Subject: Computer Science Class 12 th

An Object Oriented Programming with C

For Teacher's Use Only Q No Total Q No Q No

Dynamic Data Structures

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

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

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

SRE VIDYASAAGAR HIGHER SECONDARY SCHOOL

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

ASSIGNMENT CLASS : XII ( ) COMPUTER SCIENCE

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

CSE143 Exam with answers Problem numbering may differ from the test as given. Midterm #2 February 16, 2001

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


Computer Science (330)

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION SECOND PRE BOARD EXAMINATION CLASS XII

vinodsrivastava.com Constructor and Destructor

C++_ MARKS 40 MIN

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

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

Transcription:

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 following C++ program code: struct Ticket char Level ; int price ; ; void compute ( Ticket & T ) if ( T.Level == A ) T.price + = 50 ; if ( T.Level == B ) T.price+ = 0 ; if ( T.Level == C ) T.price+ = 0 ; cout<< T.Level << : << T. price <<endl ; void main ( ) Ticket show [ ] = C, 00, A, 50, B, 50 ; for ( int c = ; c > = 0 ; ) compute ( show [ c - - ] ) ; b) Consider the following C++ code and find the possible output(s) from the options(i) to (iv) following it. Also, write the highest and lowest character that can be assigned in the array A when the value of j =. randomize(); char C[ ] = abcdefghij, A[ ] ; for( int j=0; j<; j ++) A[j]=C [ random(j+) ] ; for(int k=; k >= 0; k -- ) cout<<a [ k ]<<"#"; Options :- i) a # b # b # A # ii) c # c # b # a # iii) d # b # c # a # iv) d # c # b # a # c) Find and write the output of the following C++ program code: #define Change ( x ) x* - 5 int array [ ]=5,,9,; int *P=array, C; for(c=; C>=0; C--) array[c]=change (array [ c ]);

for (C=0; C<=; C++) cout<<*p<<":"; P++; d) Write the names of the correct header files to compile the code successfully: ifstream FIN("EXAM.TXT"); char ST[ ]="new"; char ST[]="Delhi"; int n = strlen(st); FIN<<ST<<n <<endl; e) Find and write the output of the following C++ program code: void Convert(int&Number, int& n, int m = ) inti ; for(i=n; i<= m ; i ++) Number += i; n = i ; intresult = 0, A=,B= 9; Convert(Result, A); cout<<result << & <<A<<"&"<<B<<endl; Convert(Result, A,B); cout<<result << & << A<<"&"<<B<<endl; Convert (Result, B, A ); cout<<result << & << A<<"&"<<B<<endl; f) What are the difference between call by value and call by reference? Give example. g) Rewrite the following C++ code after removing all syntactical errors with each correction underlined. Typedef double dob; amt dob; cout<<"enter the Amount :"; cin>>amt; for ( j = ; j<=0 ; j++) cout<<amt<< "*"<<j<<end; h) Write the type of C++ tokens from the following : (i) do (ii) defaut (iii) (iv) struct

) a) Write the definition of a class SHOP in C++ with following description : Private Members - ID // data member of integer type - QTY // data member of float type - RATE // data member of float type - Amount // data member of float type - CalAmount( ) // Member function to calculate and return QTY * RATE Public Members - GetDetail( ) // A function to allow user to enter values of ID, QTY, RATE. This Function should also call CalAmount( ) function to assign value for Amount. - DispDetail( ) // A function to display the values of all data members. b) Answer the questions (i) to (iv) based on the following: class Passenger int PCode; protected: char PName[0]; Passenger( ); void Enter( ); void Show( ); ; class Train int TID; protected: char TName[0]; Train( ); void Input( ); void Display( ); ; class Ticket : public Train, private Passenger int Day, Mon, Year; Ticket( ); void Accept ( ); void Show ( ); ; void main( ) Ticket T ; i) Which type of Inheritance out of the following is illustrated in the above example? ii) Write the names of all the members, which are directly accessible by the member Function Accept( ) of class Ticket. iii) Write the names of all the members, which are directly accessible by the object T of class Ticket declared in the main( ) function. iv) What will be the order of execution of the constructors, when the object T of class Ticket declared in the main( ) function?

c) Answer the questions (i) to (iv) based on the following: class First int A; protected: float A; First( ); void Get( ); void Show( ) ; ; class Second : private First int B; protected: float B; Second( ); void Get( ); void Show( ); ; class Third : public Second int C; Third( ); void Get( ); void Show( ); ; void main( ) Third T; //Statement ; //Statement i) What will be the size of Object T declared based on class Third? ii) Write the names of all the member functions, which are directly accessible by the object T of class Third as declared in main( ) function. iii) Write Statement to call function Show( ) of class Second from the object T of class Third. iv) What will be the order of execution of the constructors, when the object T of class Third is declared inside main( )? d) What are the differences between Constructor and destructor? Give points with example. e) Observe the following C++ code and answer the questions (i) and (ii). ; class TOP int n ; void Display( ) //Member Function cout<<num<<endl;

class BOTTOM: public TOP int m ; void Display( ) //Member Function cout<<num<<endl; ; void main( ) BOTTOM B ; //Statement //Statement i) Which Object Oriented Programming feature is illustrated by the member function () and function () in class TOP and BOTTOM? ii) Write Statement and Statement to execute Member Function and Member Function respectively using the object B. f) Observe the following C++ code and answer the questions (i) and (ii). class EXAM long Code; char EName[0]; float Marks; EXAM( ) //Member Function Code=00;strcpy(EName,"Noname");Marks=0; EXAM(EXAM &E) //Member Function Code=E.Code+; strcpy(ename,e.ename); Marks=E.Marks; ; void main( ) //Statement //Statement i) In OOP what is function? Also write the use of it. ii) Write Statement and Statement to execute Member Function and Member Function respectively.. a) Write definition for a function SUMROW ( int MAT[ ][0],intR,int C ) in C++, which finds sum of the first row and last row elements of the matrix MAT (Assuming C represents number of Columns and R represents number of rows integer ). The result should be:- Sum of First Row = Sum of Last Row = b) Consider the following structure declaration. struct Library 5

int BCode ; char BName [ 0 ]; ; Write a function to Push a book into the static stack where each book is based on structure Library. All the necessary variables are passed through parameters of the function. c) Write the definition of a function Reverse(int Ar[ ], int N) in C++, which should reverse the entire content of the array Ar having N elements, without using any other array. Example: if the array Ar contains 0 5 0 5 Then the array should become 5 0 5 0 d) T[0][0] is a two dimensional array, which is stored in the memory along the row with each of its element occupying bytes, find the address of the element T[5][0], if the element T[0][5] is stored at the memory location 55000. e) Write the definition of a function ReArange(int A[ ], int N) in C++, which should shift all the elements of the array A to left side and transfer the first element to the last location. Example: if the array A contains 5 9 5 5 Then the array should become 5 9 5 5 f) Write the definition of a member function ADDREC() for a class QUEUE inc++, to add a student in a dynamically allocated Queue of Students considering the following code is already written as a part of the program. struct STUDENT int RNO; char NAME[0]; STUDENT *Next; ; class QUEUE STUDENT *Rear,*Front; QUEUE( ) Rear=NULL; Front=NULL; void ADDEREC(); void DELETEREC(); ; g) Convert the following Infix expression into postfix expression by showing the content of stack for each step. ( A + B ) * C D / E h) Evaluate the following Postfix expression showing the stack contents for each step of calculation. 50, 0, /,5,-,,5,*,+. a) Consider the following function and give the out. The file consists of 00 records. Each record of the file is based class EMPLOYEE (in Q (b) ) void Display ( ) EMPLOYEE E ; ifstream file ( employee.dat, ios :: binary ) ; file.seekg ( * sizeof ( E ) ) ; file.seekg ( * sizeof ( E ) ) ; file. read ( ( char * ) & E, sizeof ( E ) ) ; 6

cout<< First = << file. tellg ( ) / sizeof ( E ) + ; file.seekg ( 0, is :: end ) ; cout<< Second = << file. tellg ( ) / sizeof ( E ) + ; file. close ( ) ; b) Consider the following class :- class EMPLOYEE int EID; char Name[0];float Salary; void INPUT( ) cin>>eid;gets(name);cin>>salary; void OUTPUT( ) cout<<eid<<":"<<name<< : <<Salary<<endl; float RetSal( )return Salary; int retno ( ) return EID ; void UPDATE ( ) cout<< Enter Salary ; cin>> Salary ; ; Write definition of a function SUMSAL( ) in C++ to find the total salary paid to all the employees in a company. The employee s detail of this company is stored in a binary file EMPLOYEE.DAT. Display the result in the function. c) Write a function definition SEARCH( ) in C++ to count all the articles the, a and an present in a text file TEXT.TXT. Note : Ensure that the, a and an are counted as independent words and not asa part of any other word. d) The following function is used to modify a record in a binary file EMPLOYEE.DAT where each record is based on class EMPLOYEE(in Q (b) ). Fill in the blanks to execute the code successfully. void Modify ( ) fstream file ; EMPLOYEE E ; file. open ( EMPLOYEE.DAT, ios :: binary ios :: in ios :: out ) ; while ( file. read ( (char * ) &E, sizeof ( E ) ) ) if ( E. RetSal ( ) < 000 ) E. UPDATE ( ); int pos = file. tellg ( ) ; // to set the position of file pointer in order to rewrite. // to write the updated record into the file. file. close ( ) ; e) Consider the Class EMPLOYEE and write a function to display the details of a particular employee from a binary file EMPLOYEE.DAT where each record is based on class EMPLOYEE( in Q (b) ). Accept the employee number in the function. f) Write a function to count number lower case vowels (only ) in a text file INFO.TXT. 7

KUWAIT SAHODAYA EXAMINATION FIRST TERM 08-09 SUBJECT : COMPUTER SCIENCE (08) : CLASS - XII Time : Hours MM=70 Instructions- (Based on the model of CBSE Exams) ANSWER KEY SET,, Q SET SET SET. a) c) h) (i) operator (ii) punctuator (iii) punctuator (iv) none (Full Marks for ALL correct answers - (i), (ii) and (iv)) (½ Mark for any TWO correct answers out of (i), (ii) and (iv)) ( Mark for any ONE correct answer out of (i), (ii) and (iv)) b) d) f) ½ marks for each difference, two points mark mark for example. c) a) d) (i) fstream (ii) string (½ Mark for writing each correct answer) NOTE: Any other header file to be ignored d) b) g) typedefdoubledob; dobamt ; cout<<"enter the Amount :"; cin>>amt; for (int j = ; j<=0 ; j++) cout<<amt<< "*"<<j<<endl; (½ Mark for correcting each correct Error) or ( Mark for only identifying all the errors correctly) e) h) a) B : 80 A : 50 C : 0 mark for each correct line Deduct ½ mark partial answer f) g) e) 9 & 5 & 9 5 & 0 & 9 7 & 0 & ( Mark for writing each correct line) Note:Deduct only ½ Mark for not considering any or all correct placements of & Deduct only ½ Mark for not considering any or all line break g) e) c) 5:9::7:(½ Mark for writing each correct value) Note:Deduct ½ Marks if the values are written in reverse order

h) f) b) Correct options (ii) and (iv) Lowest value of array A is a and Highest is c. a) c) d) mark for differences and mark for example. b) f) e) mark for correct answer ( function overloading / polymorphism ) mark for correct answer for statements. c) a) f) ½ mark for each correct answer. ½ mark for each correct statement. d) b) a) (½ Mark for declaring class header correctly) (½ Mark for declaring data members correctly) ( Mark for defining CalAmount() correctly) (½ Mark for taking inputs in GetDetails()) (½ Mark for invoking CalAmount() inside GetDetails()) (½ Mark for defining DispDetails() correctly) (½ Mark for correctly closing class declaration with a semicolon ; ) e) d) c) i) Multiple Inheritance ( Mark for writing correct option) ii) Data Members : PName, TName, Day, Month, Year Member function : Enter, passenger::show, Input ( ),Display ( ), Ticket :: show ( Mark for writing all correct member names ) iii) Input ( ),Display ( ), Accept ( ), Ticket :: show ( Mark for writing all correct member names ) iv) ( Mark for writing correct order) NOTE: No Marks to be awarded for any other combination/order. f) e) b) i) bytes ii) Get( ), ( Show() OR Three::Show( ) ) Get( ),Two::Show() iii) T.Two::Show() iv) First, Second, Third. a) c) d) ( Mark for writing correct formula (for Row major) OR substituting formula with correct values) (Mark for correct calculation) ( Mark for final correct address) b) e) c) ( ½ Mark for correctly writing the loop) ( ½ Mark for correctly writing the logic for reversing the content) c) g) a) (½ Mark for correctly writing the loop) ( Mark for adding first row elements and last row elements) (½ Mark for displaying the results) d) f) e) ( ½ Mark for correctly writing the loop) ( ½ Mark for correctly writing the logic for reversing the content) e) d) h) marks for correct steps using stack. Note reduce marks according to the position of the error.

f) b) g) marks for correct steps using stack. Note reduce marks according to the position of the error. g) h) b) (½ Mark for correctly writing the function heading) ( Mark for checking overflow error) (½ Mark for rest of the statements) h) a) f) ( Mark for creating a new Node) ( Mark for accepting values of RNO and NAME) (½ Mark for checking EMPTY condition) (½ Mark for assigning NULL to Rear and Front as T) (½ Mark for connecting Rear with T) (½ Mark for assigning Rear as T). a) c) b) (½ Mark for opening the file correctly) (Mark for reading records from the file) (Mark for comparing the records) (½ Mark for displaying the calculated sum.) b) e) c) ( Mark for opening the text file correctly) ( Mark for reading each character (using any method) from the file) c) a) e) (½ Mark for opening the file correctly) (Mark for reading records from the file) ( ½ Mark for comparing the records along with the input of value for search) d) b) f) ( Mark for opening the text file correctly) ( Mark for reading each characterfrom the file and search for vowels) e) f) d) ½ for each correct answer, mark for correct answer. file. Seekg ( pos sizeof ( E ) ) ; file. wirte ( ( char * ) & E, sizeof ( E ) ) ; f) d) a) ½ for each correct answer, mark for correct answer. First = 7 Second = 0