0% found this document useful (0 votes)
53 views2 pages

ASSIGNMENT BINARY FILE

hgfhfgngfjnnfj

Uploaded by

Sparsh Bhatia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

ASSIGNMENT BINARY FILE

hgfhfgngfjnnfj

Uploaded by

Sparsh Bhatia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT BINARY FILE

Q1. A binary file “Book.dat” has structure [BookNo, Book_Name, Author, Price].
Write a user defined function CreateFile() to input data for a record and add to
Book.dat .
Q2. A binary file “Book.dat” has structure [BookNo, Book_Name, Author, Price].
Write a user defined function ReadFile() to Read data from Book.dat and display
records on to screen also count the total no of records present in it .

Q3. A binary file “jokes.dat” has structure [Jokeid, Type, Jokedesc].


Write a user defined function CreateFile() to input data for a record and add to
Joke.dat at the bottom of it .
Q4. A binary file “STUDENT.DAT” has structure (admission_number, Name,
Percentage).
Write a function countrec() in Python that would read contents of the file
“STUDENT.DAT” and display the details of those students whose percentage is
above 75. Also display number of students scoring above 75%
Q5. A binary file “PHONE.DAT” has structure
(Name,Address,Areacode,Phoneno).
Write a function TRANSFER() in Python that would copy all those records which are
having AreaCode as "Del" from Phone.Dat to Phoneback.Dat.
Q6. A binary file “DRINKS.DAT” has structure (Dcode,Dname,Dsize,Dprice).
i. Write a user defined function CreateFile() to input data for a record and
add to Drinks.dat.
ii. Read the record of DRINKS from a binary file and display them on screen
when DNAME has value INDYCOLA.
Q7. A binary file “Toys.DAT” has structure (Toy_code, Toy_Name, Age_range).
Write a function in Python that would read contents of the file “Toys.DAT” and
display the details of those Toys, which are meant for children of AgeRange "5 to
8".
Q8. A binary file “Gifts.DAT” has structure (Code, Item_Name, Price).
Write a function in Python that would read contents of the file “Gift.DAT” and
display the details of those Gifts, which are prices more than 2000.
Q9. A binary file “Product.DAT” has structure (Code, Item_Name, Status,MRP).
Write a function in Python that would read contents of the file “Product.DAT” and
display the details of those products, which has status as “ON OFFER.
Q10. A binary file “Photos.DAT” has structure (PCode, Ptype).
Write a function in Python that would read contents of the file “Photos.DAT”, find
and display the total number of PHOTOS of Type PORTRAIT.
Q11. A binary file “School.DAT” has structure (Scode, Sname,No_Of_Teachers).
Write a function in Python that would read contents of the file “School.DAT”, find
and display the total number of teachers, whose data is stored in the file and
display the same.

You might also like