Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Assignment -2
1. A binary file “emp.dat” has structure [EID, Ename, designation,
salary] . i. Write a user defined function CreateEmp() to input data for a record and create a file emp.dat . ii. Write a function display() in Python to display the detail of all employees whose salary is more than 50000. 2. Write a python program to append a new records in a binary file –“student.dat”. The record can have Rollno, Name and Marks. 3. Write a python program to search and display the record of the student from a binary file “Student.dat” containing students records (Rollno, Name and Marks). Roll number of the student to be searched will be entered by the user. 4. A binary file named “EMP.dat” has some records of the structure [EmpNo, EName, Post, Salary] (a) Create a binary file “EMP.dat” that stores the records of employees and display them one by one. (b) Display the records of all those employees who are getting salaries between 25000 to 30000.