0% found this document useful (0 votes)
3 views

Assignment 9

The document outlines a programming assignment consisting of multiple tasks related to file handling in C++. It includes writing programs to manage employee and item records, explaining stream classes, file operations, and the differences between binary and character files. Additionally, it covers random access to files and tasks involving reading and writing data based on specific conditions.

Uploaded by

unikkuinkela1
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Assignment 9

The document outlines a programming assignment consisting of multiple tasks related to file handling in C++. It includes writing programs to manage employee and item records, explaining stream classes, file operations, and the differences between binary and character files. Additionally, it covers random access to files and tasks involving reading and writing data based on specific conditions.

Uploaded by

unikkuinkela1
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment 9

1. Write a program to read eid, name and salary of 10 employees from keyboard and write them
into a file “emp.doc”
2. What is stream? Explain the different stream classes used in C++ for input and output with their
uses.
3. What are the different operations that can be performed on files? Describe each of the
operations with proper example.
4. How binary files are different from character files? Compare and contrast between them with
their strength and drawbacks.
5. Write a program to write records of 5 items in file ‘item.dat’. Item class should contain data
members code and price.
6. What is meant by random access to files? Describe the different functions that support random
access files.
7. Write a program to read first, third and fifth record from the file “item.dat” and display them on
monitor.
8. Write a program to calculate numbers of objects in a file
9. Write a program that reads contents of one file and writes to another file
10. Write a program that reads 1000 numbers from keyboard and write these numbers to different
files. If the number is even then write it to file “even.dat” and write to file “odd.dat” otherwise

You might also like