Page 307 - DCAP404 _Object Oriented Programming
P. 307

Object-oriented Programming




                    Notes          13.9 Keywords

                                   Command Line Parameters: The main functions may be defined not to have any parameter. In
                                   some cases, though, the program is provided with some input values at the line of execution.
                                   These values are known as command line parameter.
                                   EOF: End of file.
                                   EOL:  End of line.

                                   File: A storage unit that contains data. A file can be stored either on tape or disk.
                                   Input Stream: The stream that suppliers date to the program is known as input stream.
                                   Output Stream: The stream that receives data from the program is known as output stream.

                                   Stream: A stream is a general name given to a flow of data.
                                   13.10 Review Questions


                                   1.  How is C++ able to treat all the input and output operation uniformly?
                                   2.  Develop a simple  C++  class  that provides  rudimentary functionalities  of a Database
                                       management system including:
                                       (a)  Creating a table
                                       (b)  Record insertion
                                       (c)  Record updation
                                       (d)  Record deletion

                                       (e)  Report generation
                                   3.  Programs would not be very useful if they cannot input and/or output data from/to users.
                                       Explain.

                                   4.  Write a note on classes for file stream operations.
                                   5.  How will you open and close a file in C++?
                                   6.  Write a note on read() and write() functions.

                                   7.  Describe various file operations applicable on array of class objects.
                                   8.  Inserting data somewhere in a sequential file would require that the entire file be rewritten.
                                       Analyze.

                                   9.  A file is a collection of letters, numbers and special characters: it may be a program, a
                                       database, a dissertation, a reading list, a simple letter etc. Justify your answers with an
                                       example.

                                   10.  How can you achieve random access in C++?
                                   11.  Write an interactive menu driven program to create and read a text file.
                                   12.  Write an interactive menu driven program to create a data file, read a data file, append
                                       records, insert records and modify records. The data file has following fields: name of
                                       student, year of admission, class and section.
                                   13.  Write a program in C++ that creates a text file, which is an exact copy of a given file.






          300                               LOVELY PROFESSIONAL UNIVERSITY
   302   303   304   305   306   307   308   309   310   311   312