1. Write a program to create a binary file Book.dat to store details of books available in a school library.
Each record should be of the form:
[book_id, title, author, price]
The program should include the following functions:
i) Add new book records to the binary file.
ii) Display all the book records stored in the file.
iii) Search for a book using book_id and display its details if found; otherwise display "Book not found".
iv) Calculate and display the average price of all the books.
2. Implement a stack to store library book issue details.
Each record should contain the fields:
[Issue ID, Member Name, Book Title, Fine Amount]
Write a menu-driven program to perform the following operations:
i) PUSH(stack, record) – Add a new book issue record to the stack. Display OVERFLOW when the stack limit is exceeded.
ii) POP(stack) – Remove the most recent book issue record from the stack and return it, or display UNDERFLOW if the stack is empty.
iii) DISPLAY(stack) – Display all book issue records currently in the stack. Display STACK EMPTY if there are no records.
iv) CALCULATE(stack) – Calculate and display the total fine amount of all records in the stack.
Note:
-
Implement Underflow and Overflow conditions.
-
The stack limit is 5 records.
i) Create a function to write n lines of a story to the text file
ii) Function to display the contents of the file. Display an error if file does not exist.
iii)Function to display the following statistics of the file:
Character count
Word count
Line Count
No of words starting with capital letter
iv)
Create a function to copy all the words starting with vowels into a
new file ‘vowels.txt’ and finally display the contents of
vowels.txt
4.Write a menu-driven program to manage a CSV file named Students.csv with the following information:
[Student ID, Student Name, Class, Marks]
Implement the following functions to:
i) Accept details of n students and write them into the CSV file.
ii) Display the contents of the CSV file.
iii) Calculate and display the average marks of all the students.
iv) Search for a student using a specific Student ID and display the details if found; otherwise display an appropriate error message.
DBMS PRACTICE .
No comments:
Post a Comment