Professional Documents
Culture Documents
PROJECT BY:
PRAVEEN P. CLASS: XII
ACKNOWLEDGEMENT
I take this opportunity to express my profound sense of gratitude and respect to all those who helped me throughout this venture. I owe my regard to Mrs. Sri Vidhya Mouli, Principal of TVS cademy , for her cooperation and valua!le support and for giving me the opportunity to undertake this pro"ect work and providing the necessary infrastructure. I would like to express my heartfelt thanks to my revered teacher and guide Mrs. #ithya marnaath for her valua!le guidance, encouragement and support throughout my studentship under her at the institute. This pro"ect is her visuali$ation and owes a lot of its functionality to her. %ast !ut not the least& I owe my overwhelming gratitude to my family and friends who gave me constant support and motivation to continue with this 'ndeavour.
CONTENTS:
System description at a glance Pro!lem (escription o o )e*uirement nalysis +ardware and Software re*uirements
System specification o o o o System (esign (ata (esign rchitectural (esign (ata (ictionary
I$"'ts % e:
To add new records to the data!ase To delete a record 0 uthorised cess1 To modify the details of an individual record 0 uthorised cess1
O't"'ts % e:
To show the phone num!er for a re*uested name To show the name for a re*uested phone num!er To list the names and phone num!er of all the entry
REQUIRED OUTPUT OF THE SYSTEM: The computeri$ed system generates the following reports as/ To show the entered details of a name To show the phone num!er of the re*uested person To list all the entries To show the details of all the entries after the re*uired modifications are made.
HARDWARE AND SOFTWARE REQUIREMENTS: ssuming that a general system offers entry of a!out 3444s in num!er, the volume of the information to !e handled is a!out thousands of characters. ll this suggests that the choice of a computer 567 or e*uivalent to a!out 894 M: +ard (isk and a!out 6 to 37 ;: ) M. The availa!ility of sophisticated programming tool is imperative. Thus, .<< is chosen to program the system. +aving done this the next step is to carefully analy$e the data, identify processing element and design appropriate data !ase file.
D%t% Des!,$
(ata design is the first of the three design activities that are conducted during system development. The impact of data structure on program structure and procedural complexity leads data design to have a profound influence on systems *uality. ll the data o!"ects re*uired !y this system are listed !elow/ 1. Td.txt #ame of entry>maximum of 84 characters Phone num!er
The a!ove data can !e designed in the form of a relational data!ase with course name as the key field.
Insert entries
(isplay
(elete
uthenticated ccess
Modify
DATASTR0CT0RES
N%me
pn n #ame Phone num!er
W.e e 0se+
.lass @Ph!ook? lso stored in file @td.txt? To get phone num!er that needs to !e searched for the name To get name that needs to !e searched for the phone num!er To get name that needs to !e modified To get name that needs to !e deleted To contain the password
Desc !"t!#$
.har 84 characters 8 characters
pass Int Int inpass To get the password from the user
W.e e 0se+
,ile>To specify the phone num!er of the individual entry ,ile>to specify the name of the entry
Desc !"t!#$
.har>84characters .har>84 characters
PROCED0RE120NCTION DESCRIPTION
Cla e!t"#: mem$e" %&!'t()!
N%me
getdata01 putdata01 modify01 getname01
P' "#se
function to get data from user function to show data on screen function to get new data from user function to return type of entryAs name
Desc !"t!#$
ccepts values from user 0#ame and phone num!er1 (isplays the details 0no input re*uired1 sks whether the old details are re*uired and needs input of the new details of the modified entry details ccessor function to return the name of entry
de%(!(t()!
N%me
writeBentry01 displayall01 search!yBpho01 search!yBname01 delete01 update01
P' "#se
function to write record in !inary file function to all display phone num!er given !y user function to search name !y given phone num!er function to search phone num!er !y given name function to delete a record function to update a given record !y getting the customer name
SO0RCE CODE:
CincludeDiostream.hE CincludeDfstream.hE CincludeDconio.hE CincludeDstdio.hE CincludeDstring.hE class ph!ook F pu!lic/ char nameG84H,phnoG84H& void getdata01 F coutDDI'nter #ame/ IDDIJnI& cinEEname& coutDDI'nter Phone #o/ IDDIJnI& cinEEphno& K void putdata01 F coutDDI#ame/ IDDnameDDIJnI& coutDDIPhone #o/ IDDphnoDDIJnI& K charL getname01 F return name& K void modify01 F char nmG84H,phG84H& coutDDI#ame/ /IDDname&
coutDDIJnPhone no/ IDDphno& coutDDIJn'nter new detailsJnI& coutDDI#ew #ame/ 0'nter M.M to retain old values1I& cinEEnm& coutDDI#ew Phone no/ 0'nter M.M to retain old values1I& cinEEph& if0strcmp0nm,I.I1NO41 strcpy0name,nm1& if0strcmp0ph,I.I1NO41 strcpy0phno,ph1& K Ka,!& void insert01 F fstream f& f.open0Itd.txtI,ios//inPios//outPios//atePios//!inary1& a.getdata01& f.write00char L1 Qa,si$eof0a11& f.clear01& f.flush01& K
void displayall01 F fstream f& f.open0Itd.txtI,ios//inPios//outPios//atePios//!inary1& f.seekg041& while0f1 F f.read00char L1 Qa,si$eof0a11& if0Nf.eof011
void search!yBpho01 F int pnoO4& char pnG84H& fstream f& f.open0Itd.txtI,ios//inPios//outPios//atePios//!inary1& coutDDI'nter Phone num!er/I& cinEEpn& f.seekg041& while0f.read00char L1 Qa,si$eof0a111 F if0Nstrcmp0a.phno,pn11 F a.putdata01& pnoO3& K K if0pnoOO41 coutDDI#o Such )ecord 'xistsNNNNI& f.close01& getch01& K
void search!yBname01
F int naO4& char nG84H& fstream f& f.open0Itd.txtI,ios//inPios//outPios//atePios//!inary1& coutDDIJn'nter #ame/I& cinEEn& f.seekg041& while0f1 F f.read00char L1 Qa,si$eof0a11& if0strcmp0a.name,n1OO41 a.putdata01& naO3& K f.clear01& if0naOO41 coutDDI)ecord #ot ,oundI& getch01& K
void deleteentry01 F fstream f& f.open0Itd.txtI,ios//inPios//!inary1& fstream f3& f3.open0Itemp.txtI,ios//out1& char foundOMfM,nG84H& coutDDI'nter name whose record is to !e deletedJnI& cinEEn& f.seekg041&
while0f1 F f.read00char L1 Qa,si$eof0a11& if0strcmp0a.getname01,n1OO41 foundOMtM& else f3.write00char L1 Qa,si$eof0a11& K if0foundOOMfM1 coutDDI)ecord not foundNNNJnI& f.close01& f3.close01& remove0Itd.txtI1& rename0Itemp.txtI,Itd.txtI1& coutDDI#ow the file contains/I& displayall01& K
void update01 F fstream f& f.open0Itd.txtI,ios//inPios//outPios//atePios//!inary1& int pos& char foundOMfM,nG84H& coutDDI'nter name whose record is to !e modifiedJnI& cinEEn& f.seekg041& while0f1 F posOf.tellg01& f.read00char L1 Qa,si$eof0a11&
if0strcmp0a.getname01,n1OO41 F a.modify01& f.seekg0pos1& f.write00char L1 Qa,si$eof0a11& foundOMtM& !reak& K K if0foundOOMfM1 coutDDI)ecord not foundNNNJnI& coutDDIJn#ow the file containsJnI& f.clear01& displayall01& K
void main01 F char pnG84H,nG84H& int c,pnoO4,naO4,passO38R59,inpass& fstream f& f.open0Itd.txtI,ios//inPios//outPios//atePios//!inary1& char chOMyM& coutDDIJnJnJnJnJnJnJnJnJtJt2'%.=M' T= T'%'P+=#' (I)'.T=)S S')VI.'SJnJnJnI& coutDDIJtJtPress 'nter to .ontinue...I& getch01& while0chOOMyM1 F clrscr01&
coutDDIJnJnJtJt2'%.=M' T= T'%'P+=#' (I)'.T=)S S')VI.'SJnJnJnI& coutDDIJtJt3. 'nter recordJnI& coutDDIJtJt8. (isplay all recordsJnI& coutDDIJtJtR. Search Ph noJnI& coutDDIJtJt5. Search #ameJnI& coutDDIJtJt9. Tpdate recordJnI& coutDDIJtJt7. (elete recordJnI& coutDDIJtJtU. 'xitJnJnJnI& coutDDIJtJt'nter your choiceJnI& cinEEc& switch 0c1 F case 3/ F insert01& !reak& K case 8/ F displayall01& !reak& K case R/ F search!yBpho01& !reak& K case 5/ F search!yBname01&
!reak& K case 9/ F coutDDIJtJt PasswordJnJtJtI& cinEEinpass& if0passOOinpass1 update01& else F coutDDIJtJt2rong PasswordI& !reak& K K case 7/ F coutDDIJtJt'nter PasswordJnJtJtI& cinEEinpass& if0passOOinpass1 deleteentry01& else F coutDDIJtJt2rong PasswordI& !reak& K K case U/
!reak& K K K