File Handling Sumita Arora Practical Class 12 Computer Science Solution
P.I.P :- 5.1
Q1. Consider the file “SarojiniPoem.txt”
Autumn Song
Based on the above file, answer the following question:
Q2. Write a program to print following type of statics for the given file:
Q3. Write a program that asks a new user about userid and password and then appends it to file “security. txt” provided the give userid does not exist in the file . If it does, then display error message “User id already exist”and prompt the user to re-enter the userid. Also, make sure that the password is a least 8 characters long with at least a digit and a special character out of “$, @and %” in it.
Q4. Given a file 'mine.txt' as shown below:
Q5. Write a program that prompt the user for a file name and then read and prints the contents of the requested file in the upper case.
Q6. Write a program that reads a text file and then create a new file where each character‘s case is inverted.
Q7. Create a file phonebook.det that stores the details in following format:
Q8. Write a program to append more details to file “phonebook.det”.
Q9. Write a program to edit the phone number of “Arvind” infile “phonebook.det”. If there is no record for “Arvind”, report error.
Q10. Write a Python program to create a binary file Items.dat to store Item details of some items as per {itemno, name, price, category}.
Q11. Write a program to append some records to the binary file Items.dat, created in the previous program.
Q12. Write a Python program to modify the price of an item in the binary file Items.dat created data. Get the itemno of the item to be modified from the user.
Q13. Write a Python program to create a binary file Itemnew.dat storing all the item details of binary file Items.dat except for the item whose itemno is obtained from the user, e.g., if user gives Itemno as 1005, then Itemnew.dat should store all 'items' details of Items.dat except item 1005.
Q14. Write a Python program to get 10 items' details (itemno, name, price, category) from the user and create a CSV file (Items.csv).
Q15. Write a Python program to create a csv file (Itemnew.csv) same as the previous program, but with a delimiter character as pipe (|)
Q16. Write a program to read a file Itemnew.csv and search for an item whose itemno is obtained from the user, as the keyboard input.
Q17. Write a program to read from a file Items.csv and create a file highitems.csv, containing only those item details from Items.csv where price > 250.
please give answers for all questions
ReplyDeleteOK, VERY SOON
DeleteThere are 17 questions in this part. Please give answers of all questions
ReplyDeleteOK, VERY SOON
Deletei am suffering fever pls hep me
ReplyDeleteWhat can I do.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )