CS_Practical_file_XII
CS_Practical_file_XII
SCIENCE
PRACTICAL
5. Write a program to read a text file line by line and display each word
separated by '#'
6. Write a program to read a text file and display the number of vowels,
consonants, uppercase and lowercase in the file.
7. Write a program to remove all the lines that contains the character 'a' in
a file and write it to another textfile ‘OTHER.TXT’
8. Write a method in python to read data from a text file INDIA.TXT, to
count and display the occurrence of word ‘INDIA’
9. Write a program to input roll_no, name, marks & grade from the user
and write it to a binary file Student.dat. The program must display the
names of all the students who receive grade ‘A’.
10. Write a menu driven program to read employee data
(EmpId,EmpName,EmpSal) and write it into a binary file emp.dat. Based
on the user’s choice the program must search (), update (), delete () or
read () more data into the file.
11. Write a program to search and display all those records of the
students whose marks are 50 and above in a binary file Student.dat.
12. Write a program to generate a csv file by reading rollno, name and
marks from user. The program must display the name when rollno is
entered. If not found, displays appropriate message.
13. Create a CSV file by entering user-id and password, read and search
the password for given userid.
14. Write a program to read the dictionary dict1= {“Dev”:45,” Ravi”:56,”
tej”:78} Consisting of name and marks of students. Include a function to
push name of those students into the stack where marks are greater than
75. Display the contents of the stack.
15. Sami has a list L1 containing 10 integers you need to help him create a
program with separate functions to push () those elements from list L1
which are at even positions and pop() to empty the stack and print the
contents.
Database management MySQL commands:
1. Write queries for the following questions for the given table.
j. To change the fees of the student to 170 where roll number is 1, if the
existing fees is less than 130.
k. To add a new column ‘Area’ of type varchar in table Info.
l. To delete ‘Area’ column from Info table.
e. To display Pname and Dname from the tables stock and dealers.