Computer Science, Class XII, Chapter No.7 (Data File Handling)
|
|
- Flora Fisher
- 5 years ago
- Views:
Transcription
1 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 for creating and manipulating data files in C++? 4. What is the default file mode for input type stream and output type stream? 5. How many ways you can open a binary file EMP.DAT for writing records in C++? Write syntax of both ways. 6. What do you mean by ios::trunc, ios::nocreate, ios::noreplace and ios::binary file mode? 7. The classes defined under fstream.h derive from which classes? 8. What is the need and usage of read( ) and write( ) functions when there are get( ) and put( ) functions for I/O? 9. If you want to print the output of a program on printer then which file you have to open for writing output? 10. Differentiate between function seekg( ) & seekp( ) with example. 11. Differentiate between read, getline and get function of istream class. 12. Name two member functions common to classes ifstream and ofstream? 13. Distinguish between ios:: ate and ios :: app? 14. Differentiate between functions read( ) and write( ). /* CBSE 1999 */ 15. Write name of two member functions belonging to fstream class. /* CBSE 1998 */ 16. Distinguish between ios::out and ios::app. /* CBSE 2001*/ 17. Name two member functions of ofstream class. /* CBSE 2000*/ 18. What are the different functions available for file I/O error handling in C++? 19. Write a function in C++ to count the number of uppercase alphabets present in a text file ARTICLE.TXT. /* CBSE 2008 */ 20. Write a function in C++ to count the number of lowercase alphabets present in a text file BOOK.TXT. /* CBSE 2008 */ 21. Write a function in C++ to count the number of alphabets present in a text file PARA.TXT. 22. Write a function to count the number of words present in a text file named PARA.TXT. Assume that each word is separated by a single blank/space character and no blanks/spaces in the beginning and end of the file. /* CBSE 2006 */ 23. Write a function to count the number of blank spaces present in a text file named PARA.TXT. /* CBSE 2006 */ 24. Write a function to count the number of VOWELS present in a text file named PARA.TXT. /* CBSE 1998 */ 25. Write a function in C++ to count the number of lines present in a text file STORY.TXT. 26. Write a function in C++ to count the words to and the present in a text file POEM.TXT. /* CBSE 2010 */ 27. Write a function in C++ to count the number of words starting with capital alphabet present in a text file DATA.TXT. 28. Write a function in C++ to read the content of a text file DELHI.TXT and display all those lines on screen, which are either starting with D or starting with M. /* CBSE 2012 */ 29. Write a function in C++ to count the no. of He or She words present in a text file STORY.TXT. /* CBSE 2011*/ 30. Write a function in C++ to print the count of the word is as an independent word in a text file DIALOGUE.TXT. /* CBSE 2007 */ For example,if the content of the file DIALOGUE.TXT is: This is his book. Is this book good? Then the output of the program should be 2. Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
2 31. Write a function AECount( ) in C++, which should read each character of a text file NOTES.TXT, should count and display the occurrence of alphabets A and E (including small cases a and e too). /* CBSE 2014 */ For example,if the content of the file NOTES.TXT is: CBSE enhanced its CCE guidelines further. Then the function should display output as: A: 1 E: Write a function in C++ to count and display the number of lines starting with alphabet A present in a text file LINES.TXT. /* CBSE 2005 */ Example : If the file LINES.TXT contains the following lines, A boy is playing there. There is a playground. An aeroplane is in the sky. Alphabets and numbers are allowed in the password. The function should display the output as Assuming that a text file named FIRST.TXT contains some text written into it, write a function named vowelwords( ), that reads the file FIRST.TXT and creates a new file named SECOND.TXT, to contain only those words from the file FIRST.TXT which start with start with a lowercase vowel (i.e. with a, e, i, o, u ). For example if the file FIRST.TXT contains Carry umbrella and overcoat when it rains. Then the file SECOND.TXT shall contain: umbrella and overcoat it. /* CBSE 2004*/ 34. Given a binary file TELEPHONE.DAT, containing records of the following class Directory: /*CBSE 2008*/ class Directory { char Name[20] ; char Address[30] ; char AreaCode[5] ; char phone_no[15] ; public ; void Register( ) ; void Show( ) ; int CheckCode(char AC[ ]) { return strcmp(areacode, AC) ; ; Write a function COPYABC( ) in C++, that would copy all those records having AreaCode as 123 from TELEPHONE.DAT to TELEBACK.DAT. 35. Given a binary file GAME.DAT, containing records of the following structure type. struct Game /* CBSE 2007 */ { char GameName[20] ; char Participate[10][30] ; ; Write a function in C++ that would read contents from the file GAME.DAT and creates a file named BASKET.DAT copying only those records from GAME.DAT where the game name is Basket Ball. Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
3 36. Write a function in C++ to search for a BookNo from a binary file BOOK.DAT, assuming the binary file is containing the objects of the following class. class BOOK { int Bno; char Title[20]; int RBno(){return Bno; void Enter(){cin>>Bno;gets(Title); void Display(){cout<<Bno<<Title<<endl; 37. Following is the structure of each record in a data file named COLONY.DAT. struct COLONY /* CBSE 2006 */ { char Colony_Code[10] ; char Colony_Name[10] int No_of_People ; ; Write a function in C++ to update the file with a new value of No_of_People. The value of Colony_Code and No_of_People are read during the execution of the program. 38. Given a binary file APPLY.DAT, containing records of the following class Applicant. class Applicant /* CBSE 2005 */ { char A_Rno[10] ; //Roll number of applicant char A_Name[30] ; //Name of applicant int A_Score ; //Score of applicant void Enrol( ) { gets(a_rno) ; gets(a_name) ; cin >> A_Score ; void Status( ) { cout << setw(12) << A_Admno ; cout << setw(32) << A_Name ; cout << setw(3) << A_Score << endl ; int ReturnScore( ) {return A_Score ; ; Write a function in C++, that would read contents of file APPLY.DAT and display the details of those Students whose A_Score is above Assuming a binary file FUN.DAT is containing objects belonging to a class LAUGHTER (as defined below).write a user defined function in C++ to add more objects belonging to class LAUGHTER at the bottom of it. /* CBSE 2003*/ class LAUGHTER { int Idno;// Identification number char Type[5]; //LAUGHTER Type char Desc[255]; //Description void Newentry( ) { cin>>idno;gets(type);gets(desc); void Showonscreen( ) { cout<<idno<<.:.<<type<<endl<<desc<<endl; 40. Write a function in C++ to add new object at the bottom of the binary file Train.Dat. Assuming that binary file is containing the objects of the following class: class Train { int Tno; char Tname[20]; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
4 char start_place[20]; void enter( ) { cin>>tno ; gets(tname) ; gets(start_place); void display( ) { cout<<tno << Tname << start_place; char *ret_place( ) { return start_place; 41. Write a function in C++ to search & display the details of all trains, whose destination is Delhi from a binary file TRAIN.DAT, assuming the binary file is containing the objects of the following class. /* CBSE 2010 */ class TRAIN { int Tno; char From[20]; char To[20]; char* GetFrom( ){return From; char* GetTo( ){return To; void Input(){cin>>Tno;gets(From);gets(To); void Show(){cout<<Tno<<From<<To<<endl; 42. Write a function in C++ to search for a camera from a binary file CAMERA.DAT, containing the objects of class CAMERA. The user should enter the Model No and the function should search and display the details of the camera. /* CBSE 2011 */ class CAMERA { long ModelNo; float MegaPixel; int Zoom; char Details[120]; long GetModelNo(){return ModelNo; void Enter(){cin>> ModelNo>> MegaPixel >> Zoom; gets(details); void Display(){cout<< ModelNo<< MegaPixel<<Zoom<<Details<<endl; 43. Write a function in C++ to search for the details (Phoneno and Calls) of those phones, which have more than 800 calls from a binary file phones.dat. Assuming that this binary file contains records/objects of class Phone, which is defined below: /* CBSE 2012 */ class Phone { char Phoneno[10]; int calls; void Get(){gets(Phoneno); cin>>calls; void Billing(){cout<<Phoneno<< # <<Calls<<endl; int GetCalls() { return Calls; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
5 44. Write a function in C++ to read the objects of ANTIQUE from binary file ANTIQUE.DAT and display those antique items which are priced between and Assuming that this binary file contains records/objects of class ANTIQUE, which is defined below:/* CBSE 2013 */ class ANTIQUE { int ANO; char Aname[10]; float price; void Buy(){gets(Aname); cin>>ano>>price; void Show(){cout<<ANO<<Aname<<Price<<endl; float GetPrice() { return Price; 45. Consider the class declaration class BUS { int bus_no; char destination[20]; float distance; void read(); // read the data from file void write(); // read the data from user and store to the file. void show(); // show the data on screen Complete the member functions definitions. 46. Assuming the class Computer as follows : /* CBSE 2004 */ class computer { char chiptype[10]; float speed; void getdetails() { gets(chiptype); cin>>speed; void showdetails() { cout<< Chip <<chiptype<< Speed= <<speed; Write a function readfile( ) to read all the records present in an already existing binary file SHIP.DAT and display them on the screen, also count the number of records present in the file. 47. void main( ) /* CBSE 2006 */ { char ch = A ; fstream fileout( data.dat, ios::out) ; fileout<<ch ; int p = fileout.tellg( ) cout<<p ; What is the output if the file content before the execution of the program is the string ABC. 48. void main( ) /* CBSE 2006 */ { char ch = A ; fstream fileout( data.dat, ios :: app) ; fileout<<ch ; int p = fileout.tellg( ) ; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
6 cout << p ; What is the output if the file content before the execution of the program is the string ABC. 49. Write a function in C++ to transfer a particular type of stock from the file inventory.dat to another file backinvent.dat. Assuming that the binary file is containing the records of following structure : struct Products { int id; char Iname[30]; int type; Remember that transfer means deletion from the inventory.dat file and addition in the backinvent.dat file. 50. Observe the program segment given below carefully,and answer the question that follows: class Labrecord /* CBSE 2007 */ { int Expno, Marks; char Experiment[20]; char Checked ; void EnterExp( ) ; //function to enter Experiment details viod ShowExp( ) ; //function to display Experiment details char RChecked( ) //function to return Expno {return Checked ; void Assignmarks (int M) //function to assign Marks { Marks = M ; ; void ModifyMarks( ) { fstream File ; File.open ( Marks.Dat, ios :: binary ios :: in ios :: out) ; Labrecord L ; int Rec=0 ; while (File.read ( (char*) &L,sizeof (L) ) ) { if (L.RChecked( )= = N ) L.Assignmarks (0) else L.Assignmarks (10) //Statement 1. //Statement 2 Rec++ ; File.close( ) ; If the function ModifyMarks ( ) is supposed to modify marks for the records in the file MARKS.DAT based on their status of the member Checked (containg value either Y or N ).Write C++ statements for the statement 1 and statement 2,where, statement 1 is required to position the file write pointer to an appropriate place in the file and statement 2 is to perform the write operation with the modified record. Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
7 51. Observe the program segment given below carefully, and answer the question that follows: class Candidate /* CBSE 2008 */ { long Cld; //Candidate's Id char CName [20] ; //Candidate's Name float Marks; //Candidate's Marks void Enter() ; void Display (); void MarksChange() ; //Function to change marks long R_Cid() { return Cld; void MarksUpdate(long Id) { fstream File; File.open ("CANDIDAT.DAT",ios::binary l ios: :in ios::out); Candidate C; int Record=O, Found=O; while (!Found && File.read((char*)&C, sizeof (C) ) ) { if (Id==C. R_Cld () ) { cout«"enter new Marks" ; C.MarksChange() ; //Statement 1 //Statement 2 Found = 1; Record++; if (Found==1) cout<<"record Updated"; File.close() ; Write thestatement1 to position the File Pointer at the beginning of the Record for which the Candidate's Id matches with the argument passed, and Statement 2 to write the updated Record at that position. 52. Observe the program segment given below carefully and fill in the blanks marked by the statement1 and statement 2 using Seekg() and tellg() functions for performing the required task #include <fstream.h> class Car { char No_Plate[15],Car_type[20]; /* function to count the total no. of records in a file */ int Countrec(); int Car::Countrec() { fstream file ; file.open( Veh.dat,ios::binary ios::in); //statememt1 int bytes = //statement 2 int Count = bytes/sizeof(car); file.close(); return Count; Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
8 Computer Science, Class XII, Find the output of following C++ code considering that the binary file MEMBER.DAT exists on the hard disk with records of 100 members. /* CBSE 2015 */ class Member { int Mno; char Name[20]; void IN( ); void OUT( ); void main( ) { fstream MF ; MF.open( MEMBER.DAT,ios::binary ios::in); Member M; MF.read((char*)&M, sizeof (M) ); MF.read((char*)&M, sizeof (M) ); MF.read((char*)&M, sizeof (M) ); int POSITION= MF.tellg( )/ sizeof(m); cout<< PRESENT RECORD: <<POSITION<<endl; MF.close( ); Mohd. Hashim, PGT (Computer Sc.), hashim_mbd@yahoo.co.in,
File.seekp(File.tellp( )-sizeof(c)); //Statement 1 //File.seekp(Record*sizeof(C));
DATA FILE HANDLING OUTSIDE DELHI : 2008 4.a)Observe the program segment given below carefully, and answer the question that follows : class candidate { long Cid ; // Candidate s Id char CName[20] ; //
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 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 informationQ4. Based on File Handling 6-8 Marks File Pointers tellg() tellp() seekp()seekg() 1-2 Marks Binary File 4 Marks Text file 2 Marks
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 1. (a) Observe the program segment given below carefully and the 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 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 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 informationStudy Material for Class XII. Data File Handling
Study Material for Class XII Page 1 of 5 Data File Handling Components of C++ to be used with handling: Header s: fstream.h Classes: ifstream, ofstream, fstream File modes: in, out, in out Uses of cascaded
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 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 informationDownloaded from
ASSIGNMENT 1 TOPIC : File Handling TYPE 1 QUESTION : ( Statement write type questions ) Q1. Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using
More informationQUESTION BANK SUB: COMPUTER SCIENCE(083)
BHARATIYA VIDYA BHAVAN S V M PUBLIC SCHOOL, VADODARA QUESTION BANK SUB: COMPUTER SCIENCE(083) CHAPTER 5 Data File Handling 1 Mark Questions 1. Observe the program segment carefully and answer the question
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 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 informationChapter-12 DATA FILE HANDLING
Chapter-12 DATA FILE HANDLING Introduction: A file is a collection of related data stored in a particular area on the disk. Programs can be designed to perform the read and write operations on these files.
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 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 informationHigh Order Thinking Skill Questions Subject : Computer Science Class: XII 1 Mark Questions Programming in C++ 1. Observe the program segment carefully and answer the question that follows: int getitem_no(
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 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 informationC++ Programming Lecture 10 File Processing
C++ Programming Lecture 10 File Processing By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Outline Introduction. The Data Hierarchy. Files and Streams. Creating a Sequential
More informationDeveloped By : Ms. K. M. Sanghavi
Developed By : Ms. K. M. Sanghavi Designing Our Own Manipulators We can design our own manipulators for certain special purpose.the general form for creating a manipulator without any arguments is: ostream
More informationThis chapter introduces the notion of namespace. We also describe how to manage input and output with C++ commands via the terminal or files.
C++ PROGRAMMING LANGUAGE: NAMESPACE AND MANGEMENT OF INPUT/OUTPUT WITH C++. CAAM 519, CHAPTER 15 This chapter introduces the notion of namespace. We also describe how to manage input and output with C++
More informationChapter 14 Sequential Access Files
Chapter 14 Sequential Access Files Objectives Create file objects Open a sequential access file Determine whether a sequential access file was opened successfully Write data to a sequential access file
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 informationCHAPTER-7 Data File Handling
CHAPTER-7 Data File Handling VERY SHORT/SHORT ANSWER QUESTIONS 1. What are input and output streams? What is the significance of fstream.h file? Ans. Input stream: The stream that supplies data to the
More informationDATA FILE HANDLING. The function should create another file OUT.TXT with the text
DATA FILE HANDLING (a) What is the purpose of seekp() and seekg( )1) (b) Write a function in C++ to read a text file SPACE.TXT. Using this file create another file OUT.TXT by replacing more than one space
More informationAdvanced File Operations. Review of Files. Declaration Opening Using Closing. CS SJAllan Chapter 12 2
Chapter 12 Advanced File Operations Review of Files Declaration Opening Using Closing CS 1410 - SJAllan Chapter 12 2 1 Testing for Open Errors To see if the file is opened correctly, test as follows: in.open("cust.dat");
More informationBHARATIYA VIDYA BHAVAN S V.M.PUBLIC SCHOOL, VADODARA. Class : XII SAMPLE PAPER Max Marks : 70
BHARATIYA VIDYA BHAVAN S V.M.PUBLIC SCHOOL, VADODARA Class : XII SAMPLE PAPER Max Marks : 70 Subject : Computer Science Time Allotted : 3 hrs General Instructions : Programming Language : C++. All questions
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 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 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 informationC++ Binary File I/O. C++ file input and output are typically achieved by using an object of one of the following classes:
C++ Binary File I/O C++ file input and output are typically achieved by using an object of one of the following classes: ifstream for reading input only. ofstream for writing output only. fstream for reading
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 informationC++ files and streams. Lec 28-31
C++ files and streams Lec 28-31 Introduction So far, we have been using the iostream standard library, which provides cin and cout methods for reading from standard input and writing to standard output
More informationDELHI PUBLIC SCHOOL, RUBY PARK, KOLKATA CLASS XII SUBJECT: COMPUTER SCIENCE QUESTION BANK FILE HANDLING:-
DELHI PUBLIC SCHOOL, RUBY PARK, KOLKATA CLASS XII SUBJECT: COMPUTER SCIENCE QUESTION BANK FILE HANDLING:- 1. Write a function in C++ to count and display the number of lines not starting with alphabet
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 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 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 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 informationRandom File Access. 1. Random File Access
Random File Access 1. Random File Access In sequential file access, the file is read or written sequentially from the beginning. In random file access, you can skip around to various points in the file
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 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 informationI/O Streams and Standard I/O Devices (cont d.)
Chapter 3: Input/Output Objectives In this chapter, you will: Learn what a stream is and examine input and output streams Explore how to read data from the standard input device Learn how to use predefined
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 informationKapil Sehgal PGT Computer. Science Ankleshwar Gujarat Ch - 7. Data File Handling
Introduction Data File Handling The fstream.h Header file Data Files Opening and Closing File Steps to process a File in your Program Changing the behavior of Stream Sequential I/O With Files Detecting
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 informationVuZs Team's Work. CS201 Spring Solved by vuzs Team with Reference Written by Administrator Wednesday, 19 May :52
CS201 Spring2009 5 Solved by vuzs Team with Reference Written by Administrator Wednesday, 19 May 2010 17:52 MIDTERM EXAMINATION Spring 2009 CS201- Introduction to Programming Shared & Solved by vuzs Team
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 informationCBSE 12th Computer Science Question Papers
CBSE 12th Computer Science Question Papers General Instructions: a) This paper consist question from 1 to 7. b) Marks are mentioned to each questions for your convenience. c) The given paper is of total
More informationAdvanced I/O Concepts
Advanced Object Oriented Programming Advanced I/O Concepts Seokhee Jeon Department of Computer Engineering Kyung Hee University jeon@khu.ac.kr 1 1 Streams Diversity of input sources or output destinations
More informationC++ How to Program 14.6
C++ How to Program 14.6 14.6 Random-Access Files pg.611-pg.612 -Unlike sequential files, R.A. files are instant-access applications. Any transaction-processing system. Requiring rapid access to specific
More information91/1 COMPUTER SCIENCE. Series SHC/1. dksm ua- jksy ua- Code No. Roll No. Candidates must write the Code on the title page of the answer-book.
Series SHC/1 Roll No. jksy ua- Code No. dksm ua- Candidates must write the Code on the title page of the answer-book. Please check that this question paper contains 12 printed pages. Code number given
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 informationPlease check that this question paper contains 11 printed pages. Please write down the serial number of the question before attempting it.
Code No. 91 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 by the
More informationConsider the following example where a base class has been derived by other two classes:
Class : BCA 3rd Semester Course Code: BCA-S3-03 Course Title: Object Oriented Programming Concepts in C++ Unit IV Polymorphism The word polymorphism means having many forms. Typically, polymorphism occurs
More informationIS 0020 Program Design and Software Tools
1 IS 0020 Program Design and Software Tools Stack/Queue - File Processing Lecture 10 March 29, 2005 Introduction 2 Storage of data Arrays, variables are temporary Files are permanent Magnetic disk, optical
More informationPhysical Files and Logical Files. Opening Files. Chap 2. Fundamental File Processing Operations. File Structures. Physical file.
File Structures Physical Files and Logical Files Chap 2. Fundamental File Processing Operations Things you have to learn Physical files and logical files File processing operations: create, open, close,
More informationFile I/O. File Names and Types. I/O Streams. Stream Extraction and Insertion. A file name should reflect its contents
File I/O 1 File Names and Types A file name should reflect its contents Payroll.dat Students.txt Grades.txt A file s extension indicates the kind of data the file holds.dat,.txt general program input or
More informationProgramming II with C++ (CSNB244) Lab 10. Topics: Files and Stream
Topics: Files and Stream In this lab session, you will learn very basic and most common I/O operations required for C++ programming. The second part of this tutorial will teach you how to read and write
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 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 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 informationFall 2017 CISC/CMPE320 9/27/2017
Notices: CISC/CMPE320 Today File I/O Text, Random and Binary. Assignment 1 due next Friday at 7pm. The rest of the assignments will also be moved ahead a week. Teamwork: Let me know who the team leader
More informationObject Oriented Programming In C++
C++ Question Bank Page 1 Object Oriented Programming In C++ 1741059 to 1741065 Group F Date: 31 August, 2018 CIA 3 1. Briefly describe the various forms of get() function supported by the input stream.
More informationChapter 12: Advanced File Operations
Chapter 12: Advanced File Operations 12.1 File Operations File Operations File: a set of data stored on a computer, often on a disk drive Programs can read from, write to files Used in many applications:
More informationDISK FILE PROGRAM. ios. ofstream
[1] DEFINITION OF FILE A file is a bunch of bytes stored on some storage media like magnetic disk, optical disk or solid state media like pen-drive. In C++ a file, at its lowest level is interpreted simply
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 informationComputer Science 2006 (Delhi)
Computer Science 6 (Delhi) General Instructions: Q... All questions are compulsory.. Programming Language: C++ a. Name the header file to which the following belong () i. abs( ) ii. isupper( ) b. Illustrate
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 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 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 informationChapter 3: Input/Output
Chapter 3: Input/Output I/O: sequence of bytes (stream of bytes) from source to destination Bytes are usually characters, unless program requires other types of information Stream: sequence of characters
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 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 informationC++ does not, as a part of the language, define how data are sent out and read into the program
Input and Output C++ does not, as a part of the language, define how data are sent out and read into the program I/O implementation is hardware dependent The input and output (I/O) are handled by the standard
More information1. a) Find the correct identifiers out of the following, which can be 2 used for naming Variable, Constants or Functions in a C++ program:
SECOND PREBOARD EXAMINATION (2017 18) CLASS: XII Subject: COMPUTER SCIENCE Date: 24.1.2018 Time Allowed: 3 Hours Maximum Marks: 70 General instructions: (1) All questions are compulsory. (2) Marks are
More informationFile handling Basics. Lecture 7
File handling Basics Lecture 7 What is a File? A file is a collection of information, usually stored on a computer s disk. Information can be saved to files and then later reused. 2 File Names All files
More informationModel Sample Paper 2015
Time: 3 Hours MM: 70 Model Sample Paper 2015 Class XII Computer Science (083) Instructions: (i) (ii) All questions are compulsory. Programming Language C++. 1. (a) What is the difference between Actual
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 informationQUESTION BANK. SUBJECT CODE / Name: CS2311 OBJECT ORIENTED PROGRAMMING
QUESTION BANK DEPARTMENT:EEE SEMESTER: V SUBJECT CODE / Name: CS2311 OBJECT ORIENTED PROGRAMMING UNIT III PART - A (2 Marks) 1. What are the advantages of using exception handling? (AUC MAY 2013) In C++,
More informationInput/Output Streams: Customizing
DM560 Introduction to Programming in C++ Input/Output Streams: Customizing Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark [Based on slides by Bjarne Stroustrup]
More informationStreams in C++ Stream concept. Reference information. Stream type declarations
Stream concept A stream represent a sequence of bytes arriving, being retrieved, being stored, or being sent, in order. A stream is continuos and offer sequential access to the data. Each byte can be read
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 informationCOMP322 - Introduction to C++
COMP322 - Introduction to C++ Lecture 05 - I/O using the standard library, stl containers, stl algorithms Dan Pomerantz School of Computer Science 5 February 2013 Basic I/O in C++ Recall that in C, we
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 informationPage 1
Virtual Functions (introduction) A virtual function is one that does not really exist but it appears real in some parts of the program. Virtual functions are advanced features of the object oriented programming
More informationCOMPUTER SCIENCE Time allowed : 3hours] [Maximum Marks :70
COMPUTER SCIENCE-2010 Time allowed : 3hours] [Maximum Marks :70 Instructions (i) (ii) All questions are compulsory Programming Language : C++ 1. (a) What is the difference between automatic type conversion
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 informationStreams contd. Text: Chapter12, Big C++
Streams contd pm_jat@daiict.ac.in Text: Chapter12, Big C++ Streams Objects are Abstracted Wrapper around input/output source/destinations Steps in reading/writing streams- Open: Establish connection between
More informationCS Programming2 1 st Semester H Sheet # 8 File Processing. Princess Nora University College of Computer and Information Sciences
Princess Nora University College of Computer and Information Sciences CS 142-341 Programming2 1 st Semester 1434-1435 H Sheet # 8 File Processing Question#1 Write line of code to do the following: 1- Open
More informationStrings and Streams. Professor Hugh C. Lauer CS-2303, System Programming Concepts
Strings and Streams Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2 nd edition, by Kernighan and Ritchie, Absolute C++, by Walter
More informationLecture 9. Introduction
Lecture 9 File Processing Streams Stream I/O template hierarchy Create, update, process files Sequential and random access Formatted and raw processing Namespaces Lec 9 Programming in C++ 1 Storage of
More informationFile Operations. Lecture 16 COP 3014 Spring April 18, 2018
File Operations Lecture 16 COP 3014 Spring 2018 April 18, 2018 Input/Ouput to and from files File input and file output is an essential in programming. Most software involves more than keyboard input and
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 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 informationStreams - Object input and output in C++
Streams - Object input and output in C++ Dr. Donald Davendra Ph.D. Department of Computing Science, FEI VSB-TU Ostrava Dr. Donald Davendra Ph.D. (Department of Computing Streams - Object Science, input
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 informationChapter 3 - Notes Input/Output
Chapter 3 - Notes Input/Output I. I/O Streams and Standard I/O Devices A. I/O Background 1. Stream of Bytes: A sequence of bytes from the source to the destination. 2. 2 Types of Streams: i. Input Stream:
More informationCS201 Latest Solved MCQs
Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability
More information