0% found this document useful (0 votes)
9 views1 page

File System Problems

The document outlines practice problems for creating classes in a file system context, including a Book class for managing books, a BankAccount class for handling bank accounts, and an Employee class for managing employee data. Each class includes specific attributes and methods for adding, updating, and displaying data, with requirements for file persistence using file streams. The problems emphasize safe file updating and the use of member functions for data manipulation.

Uploaded by

Sadman Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

File System Problems

The document outlines practice problems for creating classes in a file system context, including a Book class for managing books, a BankAccount class for handling bank accounts, and an Employee class for managing employee data. Each class includes specific attributes and methods for adding, updating, and displaying data, with requirements for file persistence using file streams. The problems emphasize safe file updating and the use of member functions for data manipulation.

Uploaded by

Sadman Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

File System Practice Problems

1. Create a Book class with attributes: bookID, title, author, status


status should be: available or issued. Implement:
• Adding new books to the file.
• Displaying all books.
• Searching by title or author.
• Updating a book’s status.
Requirements:
• Use file stream to persist the data. [create a txt file]
• Use member functions like addBook(), searchBook(), updateStatus().

2. Create a BankAccount class with data members: accountNumber, holderName,


and balance. Implement methods to:
• Create a new account and save it to accounts.txt.
• Deposit and withdraw money.
• Show all accounts and individual account details.
Requirements:
• Modify specific records in the file.
• Ensure safe file updating (using a temporary file if needed).

3. Create an Employee class with empID, name, designation, salary. Implement:
• Save employee data to a file.
• Calculate and update salary after bonuses.
• Display payroll summary from file.
Requirements:
• Use constructor and setData() functions.
• Use fstream to read/write/update.

You might also like