(i) get single character using keyboard. This function is available in stdio.h. (ii) to check whether given character is alphabet or digit or not.
|
|
- Pierce Wood
- 6 years ago
- Views:
Transcription
1 ES II 2017 Class : XII Set 1 Computer Science ( Answer Key) 1. (a) Write the significance of #include directive? Explain with example. 2 # include instructs the compiler which header file or user defined files has to be included in your program for feature use which are required for handling any of the functions or statements #include<iostream.h> #include any user defined file with detail path (b) Write the related library function based upon the given information in c++. (i) get single character using keyboard. This function is available in stdio.h. (ii) to check whether given character is alphabet or digit or not. (i) getchar() (ii) isalnum() (c ) Rewrite the following program after removing the syntactical errors (if any). Underline each correction.( assume all header files included) 2 #Define float Max=70.0; int speed char stop= N ; cin>>speed; if speed >Max stop= Y ; cout<<stop<<end; #define float Max 70.0 // error 1 int speed; // error 2 char stop= N ; cin>>speed; if (speed >Max) // error 3 stop= Y ; cout<<stop<<endl; // error 4 (d) Write the output of the following program (assume all header files included) 2 void position( int &c1, int c2=3) int y=5; c1+=2; c2+=y; int p1=20, p2=4; position(p1); ES2/ XII / Comp. Science/ Set 1 Page 1 of 23
2 cout<<p1<<, <<p2<<endl; position(p2,p1); cout<<p1<<, <<p2<<endl; 22, 4 22, 6 (e) Write the output of the following c++ code. 3 class calc char grade; int bonus; calc() grade= e ; bonus=0; void down( int g) grade -=g; void up( int g) grade +=g; bonus++; void show() cout<<grade<< # <<bonus<<endl; ; calc c; c.down(2); c.show(); c.up(7); c.show(); c.down(2); c.show(); c#0 j#1 h#1 (f) Look at the following C++ code and find possible output(s) from the options(i) to (iv) following it. Also write the maximum values that can be assigned to each of the variable N and M. 2 randomize(); int N=random(3), M=random(4); int DOCK[3][3] =1,2,3, 2,3,4, 3,4,5; for( int R=0; R<N; R++) ES2/ XII / Comp. Science/ Set 1 Page 2 of 23
3 for(int C=0; C<M; C++) cout<<dock[r][c]<< ; cout<<endl; Possible outputs (i) (iii) (ii) (iv) maximum value of N is 2 Maximum value of M is 3 Correct options: (ii) and (iii) 2.(a) Differentiate between public and private members of a class in the context of OOPs? Give a suitable example illustrating accessibility/non-accessibility of each using a class and object in C++. 2 Private public Implicit visibility mode Explicit visibility mode Not accessible to member functions of derived Accesible to member functions of derived class class as well as accessible to object of that class. class A int x; protected: int y; ; void z(); A obj; cin>>obj.x; obj.z(); //not accessible // accessible (b) Observe the following C++ code and answer the questions (i) and (ii). Assume all header files included. 2 ES2/ XII / Comp. Science/ Set 1 Page 3 of 23
4 class test long tcode; char ttitle[20]; float score; test() // function 1 tcode=100; strcpy(ttitle, exam series II ); score=0; test( test &t) // function 2 tcode= t.tcode +1; strcpy(ttitle, t.ttile); score=t.score; ; // statement 1 // statement 2 (i) which OOPs feature is illustrated by function 1 and function 2 together. What are they called. (ii) Write statement 1 and statement 2 to execute function 1 and function 2 respectively. (i) Polymorphism/constructor overloading/ function overloading (ii) test t1; // statement 1 test t2=t1; // statement 2 or test t2(t1); (c) Define a class RESTRA in C++ with the following descriptions: 4 Private members: fcode of type integer ( food code) ftype of type string ( food type) fname of type string ( food name) sticker of type string getsticker() which assigns the following values for sticker as per the given food type Ftype sticker Vegetarian green Contains egg yellow Non_vegeterian red Public members: Enter () to input the values for food code, food name, food type and call function getsticker() to assign sticker. Show () which displays the content of all the data members. ES2/ XII / Comp. Science/ Set 1 Page 4 of 23
5 class restra int fcode; ; char ftype[20], fname[20], sticker[15]; float getsticker(); void enter(); void show(); void restra::enter() cout<< enter food code ; cin>>fcode; cout<< enter food name ; gets(fname); cout<< food type ; gets(ftype); getsticker(); void restra::getsticker() if( strcmpi(ftype, vegeterian )==0) strcpy(sticker, green ); if( strcmpi(ftype, Non_vegeterian )==0) strcpy(sticker, red ); if( strcmpi(ftype, contains egg )==0) void restra::show() strcpy(sticker, yellow ); cout<< food code <<fcode; cout<< \nfood name <<fname; cout<< \nfood type <<ftype; cout<< \n Sticker <<sticker; (d) Answer the questions (i) to (iv) based on the following code: 4 class AC char Model[10]; char Date_of_purchase[10]; char Company[20]; AC( ); ES2/ XII / Comp. Science/ Set 1 Page 5 of 23
6 ; void entercardetail( ); void showcardetail( ); class Accessories : protected AC protected: ; float Price; Accessories( ); char Stabilizer[30]; char AC_cover[20]; void enteraccessoriesdetails( ); void showaccessoriesdetails( ); class Dealer : public Accessories int No_of_dealers; char dealers_name[20]; int No_of_products; Dealer( ); void enterdetails( ); void showdetails( ); ; (i) How many bytes will be required by an object of class Dealer and class Accessories? size of dealer: 118 Size of accessories: 94 (ii) Which type of inheritance is illustrated in the above C++ code? Write the base class and derived class name of class Accessories. Multilevel Base class for accessories class : AC Derived class for accessories class : Dealer (iii) Write names of all the members which are accessible from the objects of Dealer. Data members: price functions: enteraccessoriesdetails( ), showaccessoriesdetails( ), enterdetails( ), showdetails( ) (iv) Write names of all the members accessible from member functions of class Dealer. data members: Stabilizer, AC_cover, Price, No_of_dealers, dealers_name, No_of_products; Functions: entercardetail( ), showcardetail( ), enteraccessoriesdetails( ), showaccessoriesdetails( ), enterdetails( ), showdetails( ); ES2/ XII / Comp. Science/ Set 1 Page 6 of 23
7 3.(a) Find the output of the following C++ code considering that the binary file BOOK.DAT exists on the hard disk with a data of 200 books. 1 class book int bid; char bname[20]; void enter(); void display(); ; fstream infile; infile.open( book.dat, ios::binary ios::in); book b; infile.seekg(5 *sizeof(b)); infile.read((char *) &b, sizeof(b)); cout<< book number <<infile.tellg()/sizeof(b) +1; infile.seekg(0, ios::end); cout<< of <<infile.tellg()/sizeof(b)<<endl; infile.close(); Book Number : 7 of 200 (b) Write a function in C++ to count the words this and these present in a text file NOTES.TXT void count() 2 ifstream if1( notes.txt ); char word[10]; int ctr=0; while(!if1.eof()) // while(if1) if1>>word; if( strcmpi( word, this )==0 strcmpi( word, these )==0) ctr++; if1.close(); cout<< The number of this/these are <<ctr; (c ) Write a function in C++ to find the sum of all the digits present in a text file "PHONE.TXT". 2 void wordcount() ifstream if1( phone.txt ); char ch; int cnt=0; while(!if1.eof()) if1.get(ch); if( isdigit(ch)) cnt+=ch; // while(if1) ES2/ XII / Comp. Science/ Set 1 Page 7 of 23
8 cout<< Sum of digits <<cnt<<endl; if1.close(); (d) Consider the following class declaration: 3 class employee int code; ; char name[20]; float salary; void input() cin>>code>>name>>salary; void show() cout<<code<<name<<salary; float retsal() return salary ; (i) Write the objects of employee to a binary file. (ii) Read the objects of employee from the binary file and display all the objects on the screen whose salary is between Rs and Rs (i) void addition() ofstream of1; employee e; of1.open( emp.dat, ios::binary ios::app); char ch; do cout<< enter details of employee ; e.input(); of1.write((char *)&e, sizeof( e)); cout<< do u want to add more records ; cin>>ch; while( ch== y ch== y ); of1.close(); (ii) void display() ES2/ XII / Comp. Science/ Set 1 Page 8 of 23
9 ifstream if1; if1.open( emp.dat, ios::binary); employee e; while( if1.read((char *)&e, sizeof(e))) if( e.retsal()>=10000 && e.retsal()<=20000) e.show(); if1.close(); ( e) Given a binary file TRAIN.DAT, containing records of the following class train type. 3 class Train int train_no; char destination[40]; int distance; void read(); void display(); int retdist() return distance; //in km // accept all details // displays train_no, destination, distance ; Write a function in C++ that would read the contents of file TRAIN.DAT and display the details of those trains which travels the distance more than 1000 km. void displaytrain() ifstream if1; if1.open( TRAIN.DAT, ios::binary); Train T; while( if1.read((char *)&T, sizeof(t))) if( T.retdist()>1000) if1.close(); T.display(); ES2/ XII / Comp. Science/ Set 1 Page 9 of 23
10 Exam Series II 2017 Class XII Computer Science ( Marking Scheme) SET-II 1.(a) What is the significance of #define directive? Give suitable example for it. 2 (i) #define is used to define a constant #define Max 10 (ii) #define is used to define macro function also #define sqr(x) (x) * (x) (b) Write the related library function based upon the given information in c++. (i) get single character using keyboard but not displayed on monitor. (ii) to convert the character into uppercase 1 (i) getch() (ii) toupper() (c ) Rewrite the program after removing the syntax error. Underline each correction. 2 (assume all header files included) cout<< Enter an integer ; cin>>n; switch( N%2) case 0 cout<< Even ; Break; case 1 cout<< Odd ; Break; int N; //error 1 cout<< Enter an integer ; cin>>n; ES2/ XII / Comp. Science/ Set 1 Page 10 of 23
11 switch( N%2) //error 2(i) case 0: cout<< Even ; break; case 1: cout<< Odd ; break; //error 3(i) //error 4(i) //error 3(ii) //error 4(ii) //error 2(ii) (d) Find the output of the following program segment: 2 #define diff(n1,n2) ((n1>n2)? n1-n2: n2-n1) int a,b, num[]=10,23,14,54,32; for( int cnt=4; cnt>0; cnt--) a=num[cnt]; b=num[cnt-1]; cout<<diff(a,b)<< # ; 22#40#9#13# (e) Find Out the output for the program( Assume all header files included) 3 class train int tno, tripno, personcount; ES2/ XII / Comp. Science/ Set 1 Page 11 of 23
12 void init( int n=1) tno=n; tripno=0; personcount=0; void trip( int tc=100) tripno++; personcount +=tc; void show(), cout<<tno<< : <<tripno<< : <<personcount<<endl; - ; train T, N; T.init(10); N.init() ; N.trip(); T.show(); T.trip(70); N.trip(40); N.show(); T.show(); 10:0:0 1:2:140 10:1:70 (f) Look at the following c++ code and find possible output(s) from the options (i) to (iv) ES2/ XII / Comp. Science/ Set 1 Page 12 of 23
13 following it. Also write the maximum values tht can be assigned to each of the variable R and C. void 2 main() randomize(); int R=random(3), C=random(4); int MAT[3][3] =1,2,3, 2,3,4, 3,4,5; for( int i=0; i<r; i++) for(int j=0; j<c; j++) cout<<mat*i+*j+<< ; cout<<endl; Possible outputs (i) (ii) (iii) (iv) Correct option : (ii) and (iii) Maximum value of C = 3 Maximum value of R =2 ES2/ XII / Comp. Science/ Set 1 Page 13 of 23
14 2. a) Differentiate between protected and private members of a class in the context of OOPs? Give a suitable example illustrating accessibility/non-accessibility of each using a class and object in C++. 2 private Implicit visibility mode Not accessible to member functions of derived class protected Explicit visibility mode Accessible to member functions of derived class class A int x; protected: int y; void z(); ; (b) Aswer the questions (i) and (ii) after going through the class 2 class travel int placecode; char place[20]; float charges; travel() //function 1, placecode=1; strcpy(place, Delhi ); charges=1000; travel( int pc, char p[], float c) //function 2 ES2/ XII / Comp. Science/ Set 1 Page 14 of 23
15 placecode=pc; strcpy(place, p); charges=c; ~travel() //function 3, cout<< Travel plan cancelled ; - void travelplan( float c) //function 4, cout<< Place << : <<place<< : << Charges < : <<charges; - ; (i) What are function 1 and function 2 combined together referred as? (ii) Which concept is illustrated by function 3? When is this function invoked? (i) function overloading/ constructor overloading/ polymorphism (ii) Destructor. When the object will be out of scope, this function will be invoked. (c ) Define a class Clothing in C++ with the following descriptions: 4 Private Members: Code Type Size Material Price Calc_Price( ) of type string of type string of type integer of type string of type float // calculates and assigns the value of Price as follows: For the value of Material as COTTON : Type Price (Rs.) TROUSER 1500 SHIRT 1200 For Material other than COTTON the above mentioned Price gets reduced by 25%. Public Members: Enter( ) // input the values of Code, Type, Size and Material and invoke the CalcPrice( ) function. ES2/ XII / Comp. Science/ Set 1 Page 15 of 23
16 Show( ) //displays the content of all the data members class clothing char code[10], type[10],material[20]; int size; float price; void calc_price( ); void enter(); void show(); ; void clothing::enter() cout<< enter code ; cin>>code; cout<< enter type ; cin>>type; cout<< enter size ; cin>>size; cout<< enter material used ; cin>>material; calc_price(); void clothing ::calc_price() if( strcmpi( material, cotton )==0) if( strcmpi( type, trouser )==0) price=1500 if((strcmpi(type, shirt )==0) price=1200; ES2/ XII / Comp. Science/ Set 1 Page 16 of 23
17 else if( strcmpi( type, trouser )==0) price=1500 * 0.75; if((strcmpi(type, shirt )==0) price=1200 * 0.75; void clothing::show() cout<< code <<code; cout<< \ntype <<type; cout<< \nsize <<size; cout<< \nmaterial used <<material; cout<< \nprice <<price; (d) Give the following class definition answer the question that is follow: 4 class University char name [20]; protected : char vc[20]; public : void estd(); void inputdata(); void outputdata(); ; ES2/ XII / Comp. Science/ Set 1 Page 17 of 23
18 class College : protected University int regno; protected: char principal() public : int no_of_students; void readdata(); void dispdata ( ); ; class Department : public College char name[20]; char HOD[20]; public : void fetchdata(int); void displaydata( ); ; i). Name the base class and derived class of college. ii) Name the data member(s) that can be accessed from function displaydata(). iii)what type of inheritance is depicted in the above class definition? iv) What will be the size of an object (in bytes) of class Department? (i) base class : university and derived class : department (ii) name, HOD,vc, no_of_student (iii) multilevel (iv) 84 ES2/ XII / Comp. Science/ Set 1 Page 18 of 23
19 3.(a) Find the output of the following C++ code considering that the binary file clients.dat exist on the hard disk with records of 100 members. 1 class client int cno; char name[20]; void in(); void out(); ; fstream cf; cf.open( client.dat, ios::binary ios::in); client c; cf.read((char *) &c, sizeof(c )); cf.read((char *) &c, sizeof(c )); cf.read((char *) &c, sizeof(c )); int pos=cf.tellg()/sizeof(c ); cout<< present record <<pos<<endl; cf.close(); present record : 3 b) Write a function count() in c++ to count and display the presence of a separate word do in a text file student.dat. 2 void countd) ES2/ XII / Comp. Science/ Set 1 Page 19 of 23
20 int cnt=0; ifstream if1( student.dat ); char word[5]; while(! if1.eof()) if1>>word; if(strcmpi( word, do )==0) cnt ++; if1.close(); cout<< number of words do <<cnt; (c) Write a function in c++ to count and display the number of lines starting with alphabet text file lines.txt. 2 A present in a void countword() int cnt=0; ifstream if1( lines.txt ); char line[80]; while(! if1.eof()) if1.getline(line,80,. ); if( line[0]== A ) cnt ++; if1.close(); cout<< number of lines starting with A are <<cnt; (d) Given a binary file student.dat, containing records of the following class student type. 3 ES2/ XII / Comp. Science/ Set 1 Page 20 of 23
21 class student char s_admno[10]; // admission number of student char s_name[30]; //name of student int percentage; // percentage of student void enterdata() gets(s_admno); gets(name); cin>>percentage; void displaydata() cout<< setw(12)<<s_admno; cout<<setw(32)<<s_name; cout<<setw(5)<<percentage<<endl; ; int returnpercentage() return percentage; Write a function in c++ that would read contents of file student.dat and display the details of those students whose percentage is above 75. void displayrecord() student s; ifstream if1; if1.open( student.dat, ios::binary); while( if1.read((char *)&s, sizeof(s))) ES2/ XII / Comp. Science/ Set 1 Page 21 of 23
22 if( s.returnpercent()>=75) s.displaydata(); of1.colse(); ( e) Given a binary file DOCTOR.DAT containing records of the following class 3 class DOCTOR char name[20]; char add[20]; char area[20]; char phone[15]; void ledger(); void disp(); ; int checkcode(char ac[]) return strcmp(area,ac); Write a function SOUTHONLY() in c++, that would copy only those records having area as SOUTH from DOCTOR.DAT to SOUTH.DAT. void copyrecord() ifstream if1; if1.open( doctor.dat, ios::binary); ofstream of1; of1.open( south.dat, ios::binary); ES2/ XII / Comp. Science/ Set 1 Page 22 of 23
23 student s; while(if1.read((char *)&s, sizeof( s)) if( (s.checkcode( south )==0) of1.write((char *)&s, sizeof(s)); if1.colse(); of1.close(); ES2/ XII / Comp. Science/ Set 1 Page 23 of 23
KENDRIYA VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015
KENDRIYA VIDAYALAYA PANGODE MONTHLY TEST AUGUST 2015 CLASS: XII COMPUTER SCIENCE TIME: 1½ hrs TOTAL MARKS: 35 1. How can we make private members inheritable? (1) 2. Find out errors in the following program:-
More information(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 informationKENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II
KENDRIYA VIDYALAYA TIRUMALAGIRI,SECUNDERABAD UNIT TEST II SUB : COMPUTER SCIENCE CLASS : XII TIME : 90 MINS M.M: 40 1.a. Differentiate between default & parameterized constructor with suitable example.
More informationHOLIDAYS 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 informationDownloaded 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 informationSample Paper, Subject: Computer Science Class 12 th Time Allowed : 3 Hr. M.M.: 70
Sample Paper, 2012-13 Subject: Computer Science Class 12 th Time Allowed : 3 Hr. M.M.: 70 General Instruction 1. Please check this question paper contains 10 printed pages. 2. Code number given on the
More informationASSIGNMENT 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(d) Rewrite the following program after removing all the syntax error(s), if any. [2] include <iostream.h> void main ( )
Sample Paper 2012 Class XII Subject Computer Science Time: 3 Hrs. M.M. 70 General instructions: 1) All questions are compulsory. 2) Read all the questions carefully. 3) Programming language C++. Q.1(a)
More informationSAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE. Sample paper-i. Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.:
SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE Sample paper-i Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.: General Instruction 1. Please check that this question paper contains 7 questions. 2.
More informationINTERNATIONAL INDIAN SCHOOL, RIYADH. Ch 1 C++ Revision tour
Grade- XII Computer Science Worksheet Ch 1 C++ Revision tour 1) Explain in brief the purpose of function prototype with the help of a suitable example. 2) What is the benefit of using default parameter/argument
More informationDELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION
DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION 2017 2018 Class: XII Subject : Computer Science Assignment No. 3 1. a) What is this pointer? Explain with example. b) Name the header file
More informationBRAIN INTERNATIONAL SCHOOL. Computer Science Assignment CLASS XII OCTOBER 2018 Chapter-7. Data File Handling in C++ Text Files
BRAIN INTERNATIONAL SCHOOL Computer Science Assignment CLASS XII OCTOBER 2018 Chapter-7. Data File Handling in C++ Text Files Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Write a C++
More informationKUWAIT SAHODAYA EXAMINATION FIRST TERM SUBJECT : COMPUTER SCIENCE (083) : CLASS - XII SET - 3 Time : 3 Hours
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
More informationKENDRIYA 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 informationJB Academy, Faizabad Half Yearly Examination Subject: Computer Science (083) Class XII
JB Academy, Faizabad Half Yearly Examination - 2017-18 Subject: Computer Science (083) Class XII Time: 3 Hours Max. Marks: 70 Instructions: i) All questions are compulsory and so attempt all. ii) Programming
More informationI Mid Semester May 2012 : Class XII : Computer Science Max Mark 50 : Time 2 Hrs. 1. a) What is macro in C++? Give example 2
I Mid Semester May 01 : Class XII : Computer Science Max Mark 50 : Time Hrs 1. a) What is macro in C++? Give example b) Give the Header file for the following functions:- i) gets ( ) ii) tolower( ) 1 c)
More informationList of Practical for Class XII Computer Science
List of Practical for Class XII Computer Science P.01. Write a complete C++ program to define class Garment with following description: Private members: Code - type string Type - type string Size - type
More informationKENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION SUBJECT COMPUTER SCIENCE
CLASS- XII MAX MARKS-70 KENDRIYA VIDYALAYA SANGATHAN TINSUKIA REGION PRE BOARD EXAMINATION 01-15 SUBJECT COMPUTER SCIENCE TIME- HOURS Q1 a) What is the Difference between Global Variable and Local Variable?
More informationINDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION
Roll Number SET 1 INDIAN SCHOOL MUSCAT FIRST TERM EXAMINATION COMPUTER SCIENCE CLASS: XII Sub. Code: 08 Time Allotted: Hr 09.05.018 Max. Marks: 70 GENERAL INSTRUCTIONS: 1. All questions are compulsory..
More informationIf 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 informationI 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 informationvinodsrivastava.com Constructor and Destructor
vinodsrivastava.com Constructor and Destructor Constructor : it is a special member function of class with the following unique features 1. It has the same name as the name of the class they belongs to
More informationCLASS XII COMPUTER SCIENCE(083) TimeAllowed : 3 HrsMax Marks : 70
1 CLASS XII COMPUTER SCIENCE(083) TimeAllowed : 3 HrsMax Marks : 70 General Instructions- (i) All questions are compulsory (ii) Programming Language: C++ 1. (a) Differentiate between call-by-value and
More informationAAA //Members of AAA }; class BBB: public AAA //intermediate class. BBB { //Members of BBB };
1. a) Explain the following concepts with example: i) Data Hiding ii) Polymorphism [3] Data Hiding: Keeping the data in private or protected area of a class to prevent it from accidental modification (change)
More informationAfter going through this lesson, you would be able to: store data in a file. access data record by record from the file. move pointer within the file
16 Files 16.1 Introduction At times it is required to store data on hard disk or floppy disk in some application program. The data is stored in these devices using the concept of file. 16.2 Objectives
More informationI BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++
No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)
More informationSRM 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 informationComputer Science. Practical File
Computer Science Practical File C++ Revision Tour 1. Write a program to perform various operations on a string without using language supported build in string functions. The operations are a) Reverse
More informationInput and Output File (Files and Stream )
Input and Output File (Files and Stream ) BITE 1513 Computer Game Programming Week 14 Scope Describe the fundamentals of input & output files. Use data files for input & output purposes. Files Normally,
More informationCSC 138 Structured Programming CHAPTER 4: TEXT FILE [PART 1]
CSC 138 Structured Programming CHAPTER 4: TEXT FILE [PART 1] LEARNING OBJECTIVES Upon completion, you should be able to: o define C++ text files o explain the benefits of using I/O file processing o explain
More information(d) Observe the following C++ code very carefully and rewrite it after removing any/all syntactical errors: [2] Include < iostream.
DELHI PUBLIC SCHOOL, RANCHI Pre Board-II Examination 2018 Computer Science (083) Time: 3 Hours Class: XII Maximum Marks: 70 General Instructions: There are 08 Number of Questions, all in total. All Questions
More informationData File Handling FILL IN THE BLANKS EACH QUESTION CARRY 1 MARK
Data File Handling FILL IN THE BLANKS EACH QUESTION CARRY 1 MARK 1.. Observe the program segment given below carefully, and answer the question that follows: class Labrecord int Expno; char Expriment[20];
More informationMARKING SCHEME COMPUTER SCIENCE (083)_XII
MARKING SCHEME COMPUTER SCIENCE (083)_XII 2014-15 SECTION A Q. 1.a Ordinary function : These are function define anywhere in the program and called directly using function name. Example void cube (int
More informationCode No. 083 Time allowed: 3 hours Maximum Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming language: C++
Sample Paper Class XII Subject Computer Science Please check that this question paper contains 7 printed pages. Code number given on the right hand side of the question paper should be written on the title
More informationComputer Science, Class XII, Chapter No.7 (Data File Handling)
Chapter No.7 (Data File Handling) 1. What is a file? How a text file is different from binary file? 2. What is stream? Name and define the streams generally used for file I/O? 3. Which header file is required
More informationCOMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII
COMPUTER SCIENCE(083) SAMPLE QUESTION PAPER CLASS XII TIME: 3 HOURS MAX.MARK: 70 General Instructions- (i) All questions are compulsory (ii) Programming Language: C++ 1 (a) When a function is overloaded,
More informationCPE Summer 2015 Exam I (150 pts) June 18, 2015
Name Closed notes and book. If you have any questions ask them. Write clearly and make sure the case of a letter is clear (where applicable) since C++ is case sensitive. You can assume that there is one
More informationDELHI PUBLIC SCHOOL BOKARO STEEL CITY
DELHI PUBLIC SCHOOL BOKARO STEEL CITY ASSIGNMENT FOR THE SESSION 2015-2016 Class: XII Subject : Computer Science Assignment No. 3 Question 1: (a) What is the difference between Call by Value and Call by
More informationSample Paper 2013 SUB: COMPUTER SCIENCE GRADE XII TIME: 3 Hrs Marks: 70
Sample Paper 2013 SUB: COMPUTER SCIENCE GRADE XII TIME: 3 Hrs Marks: 70 INSTRUCTIONS: All the questions are compulsory. i. Presentation of answers should be neat and to the point. iii. Write down the serial
More informationComputer 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 informationUnit-V File operations
Unit-V File operations What is stream? C++ IO are based on streams, which are sequence of bytes flowing in and out of the programs. A C++ stream is a flow of data into or out of a program, such as the
More informationConstructor & Classes Questions
(1)Answer the questions (i) and (ii) after going through the following program: class Match int Time; Match() //Function 1 Time=0; cout
More informationSample 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(i) case (ii) _delete (iii) WHILE (iv) 21stName
KENDRIYA VIDAYALAYA SANGATHAN ERNAKULAM REGION PREBOARD EXAMINATION 208-9 CLASS :XII MAX. MARKS : 70 SUBJECT : COMPUTER SCIENCE Instructions: TIME :3 HRS (i) Please check that this question paper contains
More informationCHAPTER 9 INHERITANCE. 9.1 Introduction
CHAPTER 9 INHERITANCE 9.1 Introduction Inheritance is the most powerful feature of an object oriented programming language. It is a process of creating new classes called derived classes, from the existing
More informationObject 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 informationCOMPUTER 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 informationAC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013
Q.2 a. Discuss the fundamental features of the object oriented programming. The fundamentals features of the OOPs are the following: (i) Encapsulation: It is a mechanism that associates the code and data
More information3. 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 informationCOMPUTER SCIENCE. Time allowed : 3 hours Maximum Marks : 70
Series OSR 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 16 printed pages. Code number given on the right hand
More informationComputer Science 330 Assignment
Computer Science 330 Assignment Note: All questions are compulsory. The marks for each question are given at the same place. Max. Marks: 20 (ii) Write your name, enrolment number, AI name and subject etc.
More informationPRINCE PUBLIC SCHOOL PRE-BOARD EXAMINATION ( ) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS
PRINCE PUBLIC SCHOOL PRE-BOARD EXAMINATION (2018-19) SAMPLE PAPER-1 COMPUTER SCIENCE XII TIME ALLOWED: 3 HOURS MAXIMUM MARKS: 70 General Instructions 1. This question paper contains 7 questions. 2. SECTION
More informationKENDRIYA VIDYALAYA SANGATHAN, COMPUTER SCIENCE (THEORY) I PRE-BOARD TIME 3 HRS CLASS XII M. Marks 70
KENDRIYA VIDYALAYA SANGATHAN, COMPUTER SCIENCE (THEORY) I PRE-BOARD TIME 3 HRS CLASS XII M. Marks 70 GENERAL INSTRUCTIONS : 1. ALL QUESTIONS ARE COMPULSORY. 2. PROGRAMMING LANGUAGE : C++ Q1. (a) Out of
More informationios ifstream fstream
File handling in C++ In most of the real time programming problems we need to store the data permanently on some secondary storage device so that it can be used later. Whenever we have to store the data
More informationvoid main() { int global=7 ; func( ::global,global) ; cout<<global<<, <<::global<< \n ; func(global,::global) ; cout<<global<<, <<::global<< \n ; }
K.V.NO.3 AFS CHAKERI AUTUMN BREAK HOME WORK 2017-18 CLASS-XII 1. a) Differentiate between an identifier and keywords. b) Name the header files, to which following inbuilt function belong to: a) abs( )
More informationConvenient way to deal large quantities of data. Store data permanently (until file is deleted).
FILE HANDLING Why to use Files: Convenient way to deal large quantities of data. Store data permanently (until file is deleted). Avoid typing data into program multiple times. Share data between programs.
More information22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time: 3 Hrs.
Scheme I Sample Question Paper Program Name : Computer Engineering Program Group Program Code : CO/CM/IF/CW Semester : Third 22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time:
More informationBITG 1113: Files and Stream LECTURE 10
BITG 1113: Files and Stream LECTURE 10 1 LEARNING OUTCOMES At the end of this lecture, you should be able to: 1. Describe the fundamentals of input & output files. 2. Use data files for input & output
More informationDownloaded from
DATA FILE HANDLING IN C++ Key Points: Text file: A text file stores information in readable and printable form. Each line of text is terminated with an EOL (End of Line) character. Binary file: A binary
More informationData 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:
Unit IV Pointers and Polymorphism in C++ Concepts of Pointer: A pointer is a variable that holds a memory address of another variable where a value lives. A pointer is declared using the * operator before
More informationGuru 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 informationDATA FILE HANDLING FILES. characters (ASCII Code) sequence of bytes, i.e. 0 s & 1 s
DATA FILE HANDLING The Language like C/C++ treat everything as a file, these languages treat keyboard, mouse, printer, Hard disk, Floppy disk and all other hardware as a file. In C++, a file, at its lowest
More informationSAMPLE PAPER 2015 SUB - COMPUTER SCIENCE - (Theory) CLASS XII Time allowed: 3 hours Maximum marks: 70
SAMPLE PAPER 215 SUB - COMPUTER SCIENCE - (Theory) CLASS XII Time allowed: 3 hours Maximum marks: 7 Instructions : i) All the questions are compulsory. ii) Programming Language (for Q. 1-4): C++ iii) Write
More informationMultiple Choice (Questions 1 14) 28 Points Select all correct answers (multiple correct answers are possible)
Name Closed notes, book and neighbor. If you have any questions ask them. Notes: Segment of code necessary C++ statements to perform the action described not a complete program Program a complete C++ program
More informationSample Paper 2012 Class XII Subject Computer Science
Sample Paper 2012 Class XII Subject Computer Science General Instruction CODE (083) 1. Please check this question paper contains 7 printed pages. 2. Code number given on the right side of question paper
More informationKENDRIYA 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 informationCBSE GUESS PAPER. Roll No. Computer Sc. XII(083)/
Roll No. CBSE GUESS PAPER Computer Sc. XII(083)/2011-12 Time Allowed 3 Hours Maximum Marks- 70 General Instructions: (i) All questions are compulsory. (ii) The paper contains 7 questions. (iii) Programming
More informationSAMPLE 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 informationCOMMON PRE-BOARD EXAMINATION COMPUTER SCIENCE
SET Subject Code: 08 COMMON PRE-BOARD EXAMINATION 07-08 COMPUTER SCIENCE CLASS XII Time Allowed: hours Maximum Marks: 70 General Instructions: Please check that this question paper contains 9 printed pages.
More informationSAMPLE PAPER-2015 Class-XII SUB:-COMPUTER SCIENCE
SAMPLE PAPER-2015 Class-XII SUB:-COMPUTER SCIENCE MAX.MARKS: 70 DURATION : 3 Hrs. 1. a) Observe the program segment given below carefully, and answer the question that follows. [1] class Book { int Book_no
More informationObject Oriented Programming Using C++ UNIT-3 I/O Streams
File - The information / data stored under a specific name on a storage device, is called a file. Stream - It refers to a sequence of bytes. Text file - It is a file that stores information in ASCII characters.
More information(1)Given a binary file PHONE.DAT, containing records of the following structure type class Phonlist { char Name[20]; char Address[30]; char
(1)Given a binary file PHONE.DAT, containing records of the following structure type class Phonlist char Name[20]; char Address[30]; char AreaCode[5]; char PhoneNo[15]; Public: void Register(); void Show();
More informationSHORT REVIEW OF CS TOPICS RANDOM NUMBERS (2 MARKS) which generates a random number in the range of 0 to n-1. For example;
SHORT REVIEW OF CS TOPICS RANDOM NUMBERS (2 MARKS) Generating Random Numbers The key function in generating random numbers is; int random (int n); which generates a random number in the range of 0 to n-1.
More informationComputer programs are associated to work with files as it helps in storing data & information permanently. File - itself a bunch of bytes stored on
Computer programs are associated to work with files as it helps in storing data & information permanently. File - itself a bunch of bytes stored on some storage devices. In C++ this is achieved through
More informationvoid 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(b) Name the header files for the following inbuilt functions. 1 (i) random() (ii) exit() Ans: (i) stdlib.h (ii) process.h/ stdlib.
HALF YEARLY EXAMINATION Session - 2018-19 Class - XII ComputerScience (ANSWER KEY) 1. (a) What is the difference between type casting and type promotion in c++? Explain with example. 2 Type casting is
More informationChapte t r r 9
Chapter 9 Session Objectives Stream Class Stream Class Hierarchy String I/O Character I/O Object I/O File Pointers and their manipulations Error handling in Files Command Line arguments OOPS WITH C++ Sahaj
More information3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.
3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.
More informationSeries SHC COMPUTER SCIENCE. Code No. 91. Roll No.
Roll No. Series SHC Code No. Please check that this question paper contains 11 printed pages. Code number given on the right hand side of the question paper should be written on the title page of the answer-book
More informationvoid display(){ cout << trainno.<< :>>Description<<endl; }; void main() {TRAIN T; Entry.(); Display.(); d) 410 e) i) south:east:south f) temttoe
Marking Scheme SUBJECT COMPUTER SCIENCE Class XII Ist Preboard 2016 Q. No. 1 a) 1 Marks for definition and 1 marks for explain relation with classes objects. the wrapping of data and operation / function
More informationCLASS XII GUESS PAPER COMPUTER SCENCE (083)
CLASS XII GUESS PAPER COMPUTER SCENCE (083) TIME: 3 hours MARKS: 70 Q1. Please check that this question paper contains 11 printed pages. Code-snippets in questions may be printed wrong rectify the errors
More information2016 COMPUTER SCIENCE
Total number of printed pages: 5 Total marks : 70 2016 COMPUTER SCIENCE Time : 3 hours General instructions: i) Approximately 15 minutes is allotted to read the question paper and revise the answers. ii)
More informationCOMPUTER 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 informationKENDRIYA 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 informationBRAIN 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 information1. 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.
PROBLEM: 1. FIBONACCI SERIES Write a C++ program to generate the Fibonacci for n terms. AIM: To write a C++ program to generate the Fibonacci for n terms. PROGRAM CODING: #include #include
More informationSECTION 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 informationTHE EMIRATES NATIONAL SCHOOL SHARJAH THIRD MODEL EXAMINATION 2015 COMPUTER SCIENCE ( Code : 083) CLASS : XII MAX MARKS: 70
THE EMIRATES NATIONAL SCHOOL SHARJAH THIRD MODEL EXAMINATION 2015 COMPUTER SCIENCE ( Code : 083) CLASS : XII MAX MARKS: 70 DATE :25/03/2015 TIME: 3Hrs Instructions: (i) All questions are compulsory. (ii)
More informationTHE EMIRATES NATIONAL SCHOOL SHARJAH THIRD MODEL EXAMINATION COMPUTER SCIENCE ( Code : 083) ANSWER KEY
THE EMIRATES NATIONAL SCHOOL SHARJAH THIRD MODEL EXAMINATION 05 ---- COMPUTER SCIENCE ( Code : 08) ANSWER KEY. MARK a) Function overloading is implemented in C++ programs when multiple functions are defined
More informationQ2) 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 informationCBSE Sample Paper 2015 Computer Science C++ Class XII Time 3hrs M.M 70
CBSE Sample Paper 2015 Computer Science C++ Class XII Time 3hrs M.M 70 Q1. A) Write short notes on typedef and #define. 2 Q1B) Give the Header files to run the following code. 1 void main() cout
More informationMOCK PRE-BOARD EXAMINATION 2017_18 Class : XII Computer Science ( Answer Key)
MOCK PRE-BOARD EXAMINATION 2017_18 Class : XII Computer Science ( Answer Key) 1. (a) In the context of inheritance, what is the difference between private and protected members of a class. Explain with
More informationAnswer Key with Marking Scheme
INDIAN SCHOOL MUSCAT HALF YEARLY EXAMINATION- 017 Subject: COMPUTER SCIENCE (Code 08) CLASS- XII Max. Marks: 70 Date: 0-09-017 Time: Hours Answer Key with Marking Scheme General Instructions: Answer all
More informationCOMPUTER 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 informationKENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION. REVISION Examination 2013 COMPUTER SCIENCE (083) CLASS XII
KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION REVISION Examination 01 COMPUTER SCIENCE (08) CLASS XII Time Allowed: Hours Maximum Marks: 70 Instructions: (i) All questions are compulsory. (ii) Programming
More informationSample 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 informationMock Test Paper-3. Computer Science. Duration : 3hrs Max Marks : 70
Mock Test Paper-3 Computer Science Mock Test Paper-3 11 Duration : 3hrs Max Marks : 70 1. (a) How does a class inforce data hiding? 2 (b) Name the header files to which the following belong- 1 (c) Rewrite
More informationKENDRIYA VIDYALAYA SANGATHAN MODEL QUESTION PAPER-5 BLUE PRINT CLASSS XII COMPUTER SCIENCE (083) TIME: 03:00 Hrs. MAX. MARKS: 70 S.No.
KENDRIYA VIDYALAYA SANGATHAN MODEL QUESTION PAPER-5 BLUE PRINT CLASSS XII COMPUTER SCIENCE (83) TIME: 3: Hrs. MAX. MARKS: 7 S.No. UNIT VS A (1 TOTAL SA I (2 Marks) SA II (3 Marks) L A (4 Marks) Mark) Review
More informationKendriyaVidyalayaSangathan Kolkata Region
KendriyaVidyalayaSangathan Kolkata Region Third Pre-Board Examination : 204-5 Please check that this question paper contains 7 questions. Please write down the Serial Number of the question before attempting
More informationCOMPUTER APPLICATIONS
COMPUTER APPLICATIONS (Theory) (Two hours) Answers to this Paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent
More information