
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
questions based on computer science file handling
Typology: Study Guides, Projects, Research
1 / 1
This page cannot be seen from the preview
Don't miss anything!

XII Computer Science File programme (File Handling) Text File Handling - 1 Create a text file Delhi.txt and write few lines about Delhi. Define a function to copy the content of Delhi.txt to sub.txt except ‘a’/’A’. Text File Handling - 2 Define a function in Python to read the content of the text file Delhi.txt and display all those lines on screen, which are either starting with ‘D’ or starting with ‘M’. Binary File Handling - 1 A binary file “Book.dat” has a structure [BookNo, Book_Name, Author, Price]. a. Write a user defined function CreateFile() to input data for a record and add to Book.dat b. Write a function CountRec(Author) in Python which accepts the Author name as parameter. Count and return number of books of the given Author “Book.dat” Binary File Handling - 2 A binary file “STUDENT.DAT” has structure (admission_number, Name, Percentage). a) Write a user defined function create_rec() to input data for a record and add to STUDENT.DAT b) Write a function count_rec() 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% CSV File Handling - 1 Write a program to create a csv file named prod.csv to write records (pid, pname, pprice) of n number of products. CSV File Handling - 2 Write a program to find average price of product from prod.csv containing pid, pname, pprice. Print all details in tabular form.