0% found this document useful (0 votes)
12 views

record 12

The document outlines various experiments related to file handling and data processing in programming. Each experiment includes an aim, such as counting lines, copying words, and handling exceptions, along with the requirement to write specific programs for binary and CSV files. It also covers stack operations and exception handling scenarios.

Uploaded by

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

record 12

The document outlines various experiments related to file handling and data processing in programming. Each experiment includes an aim, such as counting lines, copying words, and handling exceptions, along with the requirement to write specific programs for binary and CSV files. It also covers stack operations and exception handling scenarios.

Uploaded by

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

EXPT NO: TEXT FILE-1

DATE:
AIM: To count the number of lines in text files
PROGRAM

TEXT FILE

OUTPUT
EXPT NO: TEXT FILE-2
DATE:
AIM: To count the two-letter word from text file
PROGRAM

TEXT FILE

OUTPUT
EXPT NO: TEXT FILE-4
DATE:
AIM: To count the number of vowels and consonants
PROGRAM

TEXT FILE

OUTPUT
EXPT NO: TEXT FILE-3
DATE:
AIM: To copy a five-letter word from one full to another
PROGRAM

TEXT FILE

OUTPUT
EXPT NO: BINARY FILE-5
DATE:
AIM: Create a file emp.dat which has a structure(emp id, emp name ,salary).Write a
function countsal() that would read the content of the file and display the details of
those employees who ‘s salary >20000
PROGRAM

BINARY FILE

OUTPUT
EXPT NO: BINARY FILE-6
DATE:
AIM: Write a function write() to add list of names in a binary file Create another
function called scount() to read the content of the binary file and display no of records
who ‘s name starts with ’s’
PROGRAM

BINARY FILE

OUTPUT
EXPT NO: BINARY FILE-7
DATE:
AIM: Write a program to add student name,roll no,grade into a binary file.Also write
a function read() that displays the record with student’s grade ‘D’or ‘E’
PROGRAM

BINARY FILE

OUTPUT
EXPT NO: CSV FILE-9
DATE:
AIM: Write a program to create a user defined function add() to accept and add data
of employee to a csv file named record.csv.Each record consist of a list withfield
elements such as eid, ename, mobile, salary location. Create another function countr()
which count the no of records
PROGRAM

CSV FILE

OUTPUT
EXPT NO: CSV FILE-10
DATE:
AIM: : Write a program to create a user defined function add() to accept and add
data of employee to a csv file named field.csv.Each record consist of a list withfield
elements such as fid, fname, fprice. Create another function search() to display the
records of a furniture price >10000 of
PROGRAM

CSV FILE

OUTPUT
EXPT NO: CSV FILE-11
DATE:
AIM: Write a function that reads a csv file and creates another csv file with the same
content except the line begins with eid<10
PROGRAM

CSV FILE

OUTPUT
EXPT NO: BINARY FILE-8
DATE:
AIM: Write a programto add Admission number ,Name, Percentage into a binary file.
Also write a function countrec() that displays the record with percentage>75
PROGRAM

BINARY FILE

OUTPUT
EXPT NO: STACK-1
DATE:
AIM: Write a program to create a stack and do the following operations like push, pop,
peek and display the element in stack. Attributes (Name, age, dept, salary)
PROGRAM

Output
EXPT NO: STACK-2
DATE:
AIM: Write a program for push(list) and pop(list) for performing push and pop
operations with a stack of list containing integers. Push only even numbers into the
stack.
PROGRAM

Output
EXPT NO: STACK-3
DATE:
AIM: (i)Create a function push(N) which accepts list of string in the parameter n and
pushes all strings which has no vowels in it into the list novowel.
(ii) Create a function pop(N) which deleted last element and displays "stack empty" if
there's no element to delete.
PROGRAM

Output
EXPT NO: STACK-4
DATE:
AIM: Maneesh created a dictionary containing names and marks as key value pairs of
six students
WAP with seperate user defined function to perform the following subdivision
(i)Push the keys (names, mark) into a stack where corresponding value is greater than
70
(ii)Pop and display the content of the stack
PROGRAM

Output
EXPT NO: EXCEPTION HANDLING-1
DATE:
AIM: WAP to handle zerodivision error exception when dividing a number by zero

PROGRAM

Output
EXPT NO: EXCEPTION HANDLING-2
DATE:
AIM: WAP that prompts the user to input and integer and raise a value error exception
if the input is not a valid integer.
PROGRAM

Output
EXPT NO: EXCEPTION HANDLING-3
DATE:
AIM: WAP that opens a file and handles a filenotfound error exception if file does not
exist
PROGRAM

Output
EXPT NO: EXCEPTION HANDLING-4
DATE:
AIM: WAP that opens a file and handles a permission error exception if there is a
permission issue.
PROGRAM

Output

You might also like