JB ACADEMY HALF-YEARLY EXAMINATION 2016 CLASS XII COMPUTER SCIENCE. Time: 3:00 Hrs. M.M.: 70

Similar documents
VIDYA BHARATI SCHOOL

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

SAMPLE PAPER-2015 Class-XII SUB:-COMPUTER SCIENCE

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

INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION

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


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

Please check that this question paper contains 11 printed pages. Please write down the serial number of the question before attempting it.

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

Downloaded-From:-

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

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

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

KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE

DELHI PUBLIC SCHOOL, RUBY PARK, KOLKATA CLASS XII SUBJECT: COMPUTER SCIENCE QUESTION BANK FILE HANDLING:-

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

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION COMPUTER SCIENCE (083)

Sample Paper Class XII SUBJECT : COMPUTER SCIENCE

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

HOLIDAYS HOMEWORK CLASS : XII. Subject : Computer Science

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

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

INDIAN SCHOOL DARSAIT DEPARTMENT OF ICT

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

Computer Science XII Important Concepts for CBSE Examination Questions

COMPUTER SCIENCE 1998 (Delhi Board)

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

DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION

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

CLASS XII GUESS PAPER COMPUTER SCENCE (083)

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

COMPUTER SCIENCE (083)

COMPUTER SCIENCE SAM PLE PAPER 2-HALF YEARLY EXAMINATION

DELHI PUBLIC SCHOOL BOKARO STEEL CITY

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

Sample Paper, 2015 Subject: Computer Science Class 12 th

QUESTION BANK SUB: COMPUTER SCIENCE(083)

THE EMIRATES NATIONAL SCHOOL SHARJAH THIRD MODEL EXAMINATION 2015 COMPUTER SCIENCE ( Code : 083) CLASS : XII MAX MARKS: 70

COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII

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

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

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

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

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

Computer Science 2006 (Outside Delhi)

COMMON PRE-BOARD EXAMINATION COMPUTER SCIENCE

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION FIRST COMMON PRE BOARD EXAMINATION

Model Sample Paper 2015

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

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


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

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

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

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

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

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

Computer Science 330 Assignment

KendriyaVidyalayaSangathan Kolkata Region

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

C++ 8. Constructors and Destructors

COMPUTER SCIENCE

CBSE Sample Paper 2015 Computer Science C++ Class XII Time 3hrs M.M 70

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

Q4. Based on File Handling 6-8 Marks File Pointers tellg() tellp() seekp()seekg() 1-2 Marks Binary File 4 Marks Text file 2 Marks

Object Oriented Programming. Solved MCQs - Part 2

Downloaded from

Subject: Computer Science

Short Notes of CS201

KENDRIYA VIDYALAYA IIT CAMPUS CHENNAI 36 COMPUTER SCIENCE. Half Yearly

CS201 - Introduction to Programming Glossary By

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

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

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

CS201 Some Important Definitions


Downloaded from

KENDRIYA VIDYALAYA SANGATHAN DEHRADUN REGION 1 st Pre-Board Examination, Class XII Computer Science(083) Time: 3 Hours Max.

Sample Paper 2012 Class XII Subject Computer Science

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:

Padasalai.Net s Model Question Paper

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

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

Name: Username: I. 20. Section: II. p p p III. p p p p Total 100. CMSC 202 Section 06 Fall 2015

Introduction to Programming Using Java (98-388)

KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II

General Instructions:

CS201 Latest Solved MCQs

KENDRIYA VIDYALAYA SANGATHAN- ERNAKULAM REGION MODEL PAPER - CLASS XII COMPUTER SCIENCE (083)

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

Review Questions for Final Exam

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

This chapter introduces the notion of namespace. We also describe how to manage input and output with C++ commands via the terminal or files.

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

THE INDIAN COMMUNITY SCHOOL, KUWAIT

VALLIAMMAI ENGINEERING COLLEGE

(1)Given a binary file PHONE.DAT, containing records of the following structure type class Phonlist { char Name[20]; char Address[30]; char

Answer Key with Marking Scheme

Darshan Institute of Engineering & Technology for Diploma Studies

Transcription:

JB ACADEMY HALF-YEARLY EXAMINATION 2016 CLASS XII COMPUTER SCIENCE Time: 3:00 Hrs. M.M.: 70 Q.1 (a) Explain in brief the purpose of function prototype with the help of a suitable example. (b) Identify the errors in the following program code: #include<iostream.h> void main( ) int A[10]; A=[3,2,5,4,7,9,10]; for( p = 0; p<=6; p++) { if(a[p]%2==0) int S = S+A[p]; } cout<<s; } Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. #include<iostream.h> void main( ) { Struct movie { char moviename[20]; char movietype; int tic_cost=100; } MOVIE; cout << enter movie name &movie type\n ; gets(moviename); gets(movietype); } (d) Find the output of the following C++ program: class Class { int Cno,total; char section; Class(int no=1) { Cno=no; section='a'; total=30; } void addmission(int c=20) { section++; total+=c; } void ClassShow() { cout<<cno<<":"<<section<<":"<<total<<endl; } } ; void main() { Class C1(5),C2; C1.addmission(25); C1.ClassShow(); C2.addmission(); C1.addmission(30); C2.ClassShow(); C1.ClassShow(); } Pg-1

(e) Study the following C++ program and select the possible output(s) from it. void main() { randomize(); char city[ ]={ PKD, EKM, TVM, KOL, CAL }; int ZEN; for(int i=0;i<3;i++); { ZEN=random(2)+1; cout<<city[zen]<< @ ; } } (i) PKD@ EKM @TVM@ (iii) TVM@KOL@CAL@ (ii) EKM @TVM@ EKM @ (iv) TVM@ EKM @TVM@ (f) Find the output of the following program : #include<iostream.h> void switchover(int A[ ],int N, int split) { for(int K = 0; K<N; K++) if(k<split) A[K] += K; else A[K]*= K; } void display(int A[ ],int N) { for(int K = 0; K<N; K++) If (K%2== 0) cout<<a[k]<<"%" else cout<<a[k]<<endl; } void main( ) { int H[ ] = {5,10,20,50,40,30}; switchover(h,6,3); display(h,6); } Q.2 (a) How encapsulation and abstraction are implemented in C++ language? Explain with an example. (b) What is Function Overloading? Give an example in C++ to illustrate the same using constructor. What do you mean by virtual base class? How is it use full in programming? (d) Answer the questions (i) to (iv) after going through the following class. class player { int health, age; public : player() { health = 7; age = 17; } //constructor1 player( int h, int a) { health=h; age= a; } // constructor 2 player(player &p) {...} //constructor 3 ~player() { cout << \nmemory free ; }; void main() { player p1(9,26); //statement 1 player p2 = p1; //statement 2 } Pg-2

(i) (ii) (iii) Write the name of construtor1, constructor2 and constructor3. When p2 object is created, specify which constructor gets invoked and why? Write complete definition of constructor. Q.3 (a) Define a class Tourist in C++ with the following description : Data Member: cno to store city no., Ctype to store character A, B, C, D as city type, perkm to store kilo Meter charges, dis to store distance travelled (in KM) Member Function: A constructor to initialize data members as Ctype as A and Cno as 0. A function citycharges to assign perkm as per the following table : Ctype PerKm A 20 B 18 C 15 A function RegisterCab() to allow user to enter the values of Cno and Ctype and also call citycharges() to assign perkm charges. A function DisplayCab() to show the data members. (b) Define a class Departmental with the following specification : private data members :- Prod_name string (45 charactes) [ Product name] Listprice long Dis_Price long [ Discount Price] Net long [Net Price ] Dis_type char(f or N) [ Discount type] Cal_price() The store gives a 10% discount on every product it sells. However at the time of festival season the store gives 7% festival discount after 10% regular discount. The discount type can be checked by tracking the discount type. Where F means festival and N means Non-festival.The Cal_price() will calculate the Discount Price and Net Price on the basis of the following table. Product Name List Price(Rs.) Washing Machine 12000 Colour Television 17000 Refrigerator 18000 OTG 8000 CD Player 4500 public members :- Constructor to initialize the string elements with NULL, numeric elements with 0 and character elements with N Accept() Ask the store manager to enter Product name, list Price and discount type. The function will call Cal_price() to calculate Discount Price and Net Price. ShowBill() To generate the bill to the customer with all the details of his/her purchase along with the bill amount including discount price and net price. Answer the questions (i) to (iv) based on the following code : class DRUG { char catg[10]; char DOF[10], comp[20]; DRUG( ); void endrug( ); Pg-3

void showdrug( ); }; class TABLET { protected: char tname[30],volabel[20]; TABLET( ); void entab( ); void showtab( ); }; class PAINKILLER : protected DRUG, public TABLET { int dose, usedays; long double, price; char seffect[20]; public : void entpain( ); void showpain( ); }; (i) How many bytes will be required by an object of PAINKILLER (ii) Write names of all the member functions of class PAINKILLER. (iii) Write names off all members accessible from object of class PAINKILLER. (iv) Write names of all data members accessible from functions of class PAINKILLER. (d) Consider the following C++ declaration and answer the questions given below: class A { void any( ); protected: int a, b; void proc( ); A(); void geta( ); void puta( ); }; class B : protected A { int c,d; protected: int e, f; void getb( ); int g; B ( ); void putb( ); }; class C : private B { int p; protected: int q; void getc( ); int r; void showc( ); }; i. Name all the member functions and data members which are accessible by the object of class C? ii. Name the base class and derived class of class B? iii. Name the data members which are accessible from member functions of class C? iv. How many bytes will an object belonging to the class C require? Q.4 (a) Suppose an array P containing float is arranged in ascending order. Write a user defined Pg-4

function in C++ to search for one float from P with the help of binary search method. The function should return an integer 0 to show absence of the number and integer 1 to show presence of the number in the array. the function should have the parameters as (1) an array P (2) the number DATA to be searched (3) number of elements N. (b) Suppose A,B,C are arrays of size m, n, m+n respectively. Array A is stored in ascending order and array B is in descending order. Write a function to receive 3 arrays and their sizes to store the elements of A and B into C in descending order. Write a function in C++ to perform Insert and delete operation in a static stack containing integers. (d) Write a function in C++, which accepts an integer array and its size as arguments and swap the elements of every even location with its following odd location. example : if an array of nine elements initially contains the elements as 2,4,1,6,5,7,9,23,10 then the function should rearrange the array as 4,2,6,1,7,5,23,9,10 Q.5 (a) Assume a text file coordinate.txt is already created. Using this file create a C++ function to count the number of.words having first character capital. (b) Write a function in C++ to count and display the no of three letter words in the file VOWEL.TXT. Example: If the file contains: A boy is playing there. I love to eat pizza. A plane is in the sky. Then the output should be: 4 Write a function in C++ to search for a laptop from a binary file "LAPTOP.DAT" containing the objects of class LAPTOP (as defined below). The user should enter the Model No and the function should search and display the details of the laptop. class LAPTOP { long ModelNo ; float RAM, HDD ; char Details [120] ; void StockEnter ( ) { cin>>modelno>>ram>>hdd; gets (Details); } void StockDisplay ( ) { cout<<modelno<<ram<<hdd<<details<<endl; } long ReturnModelNo ( ) {return ModelNo ;} } ; (d) Observe the program given below carefully, and answer the question that follows: class Member { int Member_no ; char Member_name[20] ; public : void enterdetails ( ) ; //function to enter Member details void showdetails ( ) ; //function to display Member details int RMember_no( ) //function to return Member_no { return Member_no ;} } ; Pg-5

void Update (Member NEW) { fstream File ; File.open( MEMBER.DAT, ios :: binary l ios :: in l ios :: out) ; Member OM ; int Recordsread = 0, Found = 0 ; while (!Found && File.read((char*) & OM, sizeof(om))) { Recordsread++ ; if (NEW.RMember_no( ) == OM.RMember_no( )) { // Statement 1 // Statement 2 Found = 1 ; } else File.write((char*) & OM, sizeof(om)) ; } if (!Found) cout<< Record for modification does not exist ; File.close( ) ; } If the function Update( ) is supposed to modify a record in file MEMBER.DAT with the values of Member NEW passed to its argument, write the appropriate statements for statement1using seekp( ) or seekg( ) whichever needed, statement 2 using read( ) or write( ) method, whichever needed in the above code that would write the modified record at its proper place. Q.6 (a) What are different file modes? What is their role in handling data file? (b) Write about following terms: (i) getline ( ) (ii) file pointers (iii) Containership (iv) Explicit constructor Name the header files, to which the following built-in functions belong. (i) strcpy( ) (ii)random( ) (iii) islower( ) (iv) gets( [1] Pg-6