0% found this document useful (0 votes)
62 views

Question based binary file handling cs

Uploaded by

avinashk9548
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Question based binary file handling cs

Uploaded by

avinashk9548
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Question based binary file handling

Q1. You are programmer in a software company,Your work profile is to manage the
records of various employees. For this you want following information of each employee
to be stored-

Employee_id – integer
Employee_Name – string
Emoployee_job – string
Employee_sal – float

As a programmer complete the following task-

I) Write a function INPUT_DATA() to input the data of an employee and append it in


a binary file.
II) Write a function UPDATE_SAL() to update the salary of employees by Rs10000/-
whose job is “programmer”.
III) Write a function READ_DATA() to read the data from the binary file and display
the data of all those employees who are not "Engg".

Q2 Manoj is working in a sports college. He needs to manage the records of the teams
in each Sport. For this, he wants the following information of the students to be stored in
the binary file SPORT.DAT-

 SportName
 TeamName
 No_Players
You, as a programmer of the company, have been assigned to do this job for the
college.

i) Create the binary file SPORT.DAT


ii) Write a function AddTeam to input the details and add a record to the file.
iii) Write a function, copyData(), that reads contents from the file SPORT.DAT and
copies the records with Sport name as “Basket Ball” to the file named
BASKET.DAT. The function should also return the total number of records copied
to the file BASKET.DAT.

Q3. Ajay has written a code and created a binary file product.dat with pid, name, brand
and cost. The file contains 10 records. Help him to do the following task –
a. Write a function to input data of product and append in the binary file.
b. Write a function to update the data of product whose cost is more than 200 and
change their brand as “sony”.
c. Write a function to read all the data from binary file and display those products whose
brand is not “LG”.

You might also like