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.