0% found this document useful (0 votes)
39 views1 page

File Handling Questions To Practice For Term1 Practical

g

Uploaded by

Souvik Dey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

File Handling Questions To Practice For Term1 Practical

g

Uploaded by

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

COMPUTER SCIENCE PRACTIAL QUESTIONS –

FILE HANDLING

1. Write a program to read a text file a1.txt, line by line and display each word separated by a #.

2. Write a program to read a text file word.txt and display the number of spaces/words/digits vowels/
consonants/ uppercase/ lowercase characters in the file.

3. Write a program to read a file FILE1.TXT , Remove all the lines that contain the character `a' and write those to
another file FILE2.TXT.

12 Write a program to read a text file EMAIL.TXT and display the number of gmail ids .Also the program should
display the most occurring word in the file.

13. Considering the dictionary Company { ‘Company name ’ : , ‘Turnover’ : }

i. Take the input from the user for 3 companies and write in COMPANY.DAT
II. Display those members where TURNOVER of the company is more than 5 Crores.

14. Write a program to display the following:

Menu driven program


1. add data
2. read entire file
3. Search specific record (ask for the roll number)
4. Update the record (ask for the roll number)
5. Delete
6. Exit

The above should be able to perform the functionality on a dictionary STUDENTDATA(having roll number and
stream). Also end of file and file not found error should be handled.

15. Write a program to create a csv file sports.csv (through the list) to take inputs sportscode, nameofthesport,
noofcompetitionsheld and prizeswon. Ask for the choice from the user and keep adding till user enters ‘Y’ as
choice.

16. Considering the same file above in question 15, display all the records from the file where nameofthesport is
entered by the user.

17. Jacqline of class 12 is writing a program to create a CSV file “user.csv” which will contain user name and
password for some entries. While taking input from the user, password should be checked for the following
conditions:
1. at least 8 characters long
2 should have one upper case character
3. should have at least one digit.
4. should have one special character.

18. Professor Islam has told students to create a csv file having research id and data collected (numeric) from an
experiment. The file should have at least 5 records. Write a program to read a file RESEARCH.CSV created and
display only those records where data collected is more than 52.

You might also like