Friday, 2 January 2026

External Practical Practice


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.

3. Write a menu driven program to perform the following operation into a text file ‘ Story.txt

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 .


Consider the below tables :

CUSTOMERS

CustomerID | CustomerName | ContactNumber | City --------------------------------------------------- 101 | Aarav Sharma | 9123456780 | Pune 102 | Vivaan Patel | 9876543210 | Ahmedabad 103 | Aditya Singh | 9012345678 | Mumbai 104 | Anaya Gupta | 9345678123 | Jaipur 105 | Diya Mehta | 9567812345 | Kochi

ORDERS 

OrderID | CustomerID | OrderDate | Amount -------------------------------------------- 321 | 101 | 2024-11-10 | 300 322 | 102 | 2024-11-18 | 650 323 | 101 | 2025-02-05 | 200 324 | 103 | 2025-02-12 | 350 325 | 104 | 2025-03-01 | 500 326 | 105 | 2025-03-08 | 750


1.Display the customer name and city of customers who have placed an order of amount greater than 400
2.Display the names of customers who placed orders in January 2025
3.Find the total amount spent by each customer
4.Display the maximum order amount placed by any customer
5.Display the average order amount city-wise in descending order
6.Display the names of customers who live in cities starting with letter ‘M’
7.Display the CustomerID and total amount for customers whose total spending exceeds 400
8.Increase the order amount of the 2025 customers by 10 percent
9.Delete the orders of 2024 December