questions file handling, Study Guides, Projects, Research of Computer science

questions based on computer science file handling

Typology: Study Guides, Projects, Research

2022/2023

Uploaded on 01/23/2026

udita-paul
udita-paul 🇮🇳

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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.

Partial preview of the text

Download questions file handling and more Study Guides, Projects, Research Computer science in PDF only on Docsity!

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.