practical file cs
practical file cs
SUBMITTEDTO:- SUBMITTEDBY:-
Mrs.PoojaBajaj ISHANT GOYAL
Senior ComputerInstructor XII S1
GMSSS-16 ROLLNO. – 40
INDEX
S. ProgramDescripsion P Remarks
N ag
o. e
N
o.
0 ToenterthenumberoftermsandtoprinttheFibonacci Series. 01
1
0 Toenterthestringandtocheckifit’spalindromeornot 02
2
0 Todisplaysquarerootofanumberusingmathmodule 03
3
0 Tofindfactorialofagivennumber 04
4
0 To implement calculator func ons using the concept of 05
5 userdefined modules
0 Toreadtextfileanddisplaythecontentlinebylinewitheach word 09
6 separated by #
0 Toreadthecontentoffileanddisplaythecountofvowels, 10
7 consonants, uppercase and lowercase le ers
0 Togetstudentdata(rollno.,nameandmarks)fromuserand 11
8 write onto a binary file(stu.dat)
0 Toopenfilestu.datandsearchforrecordswithrollnumbers as 13
9 15 or 12. If found, display the records
1 TocreateaCSVfileandstoreempno.,name,salaryand search 14
0 any empno and display his record
1 To implement all basic opera ons of a stack, such as 16
1 (PUSH opera on), (POP opera on) and (Traversal opera
on)
1 Amenu-drivenprogramtoperformvariouslistoperaons: 18
2 a) Append
b) Insert
c) Appendalisttoanotherlist
d) Modifyelement
e) Deleteexisngelementfromgivenposion
f) Deleteexisngelementwithgiven value
1 SQLCommandExercise-1 20
3
1 SQLCommandExercise-2 21
4
1 SQLCommandExercise-3 22
5
1 ToIntegrateMySQLwithPython(InserngRecordsand 23
6 Displaying Records)
1 ToIntegrateMySQLwithPython(SearchingRecordsand 25
7 Displaying Records)
1 ToIntegrateMySQLwithPython(UpdangRecords) 26
8
1. FIBONACCISERIES
SOURCECODE:
OUTPUT:
2. PALINDROME
SOURCECODE:
OUTPUT:
3. SQUAREROOTOFANUMBER
SOURCECODE:
OUTPUT:
4. FACTORIALOFANUMBER
SOURCECODE:
OUTPUT:
5. CALCULATORFUNCTIONS
SOURCECODE:
OUTPUT:
y
OUTPUT:
TEXTFILEUSEDIN
PROGRAM 6 & 7:
6. DISPLAYINGTHECONTENTOFATEXTFILE-
LINEBYLINE,EACHWORDSEPARATEDBY‘#’SOURCE
CODE:
OUTPUT:
7. READINGATEXTFILEANDDISPLAYINGTHECOUNT
OFVOWELS,CONSONANTS,UPPERCASE,LOWERC
ASELETTERS
SOURCECODE:
OUTPUT:
8. WRITINGONTOABINARYFILEBYGET
TINGDATAFROMUSER
SOURCECODE:
OUTPUT:
BINARYFILE:
9. SEARCHFORRECORDSWITHROLLNO.12/15INTHE
BINARYFILE
SOURCECODE:
OUTPUT:
10. CREATINGACSVFILEANDTHENSEARCHINGFORAP
ARTICULARRECORDINIT
SOURCECODE:
OUTPUT:
FILECREATED:
FILECREATED:
11. BASICOPERATIONSOFASTACK
SOURCECODE:
OUTPUT:
12. VARIOUSLISTOPERATIONS
SOURCECODE:
OUTPUT:
13. SQLCOMMANDEXERCISE–1
14. SQLCOMMANDEXERCISE–2
15. SQLCOMMANDEXERCISE–3
16. INTEGRATINGMYSQLWITHPYTHON(INS
ERTINGANDDISPLAYINGRECORDS)
SOURCECODE:
OUTPUT:
17. INTEGRATINGMYSQLWITHPYTHON(SEAR
CHINGANDDISPLAYINGRECORDS)SOURCECO
DE:
OUTPUT:
18. INTEGRATINGMYSQLWITHPYTHON(U
PDATINGRECORDS)
SOURCECODE:
OUTPUT:
MODIFIED TABLE: