Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have a phone menu UNix script. I want to add a search and modify a phone recor

ID: 3659258 • Letter: I

Question

I have a phone menu UNix script. I want to add a search and modify a phone record by using the phone number as the search method. WHat is the command for modify record

Explanation / Answer

Write a program of telephone directory which does below functions using file. 1) Inserts person name and telephone number in a file 2) Displays all records from a file 3) Search telephone number based on person name from a file 4) Search person name based on telephone number from a file 5) Update telephone number by providing person name Download Sourcecode for Program of telephone directory (Size: 1.06 KB) Code for Program of telephone directory in C++ Programming / / T e l e p h o n e D i r e c t o r y # i n c l u d e # i n c l u d e # i n c l u d e # i n c l u d e # i n c l u d e c l a s s p h o n e B o o k { c h a r n ame [ 2 0 ] , p h n o [ 1 5 ] ; p u b l i c : v o i d g e t d a t a ( ) ; v o i d s h o wd a t a ( ) ; c h a r * g e t n ame ( ) { r e t u r n n ame ; } c h a r * g e t p h n o ( ) { r e t u r n p h n o ; } v o i d u p d a t e ( c h a r * nm , c h a r * t e l n o ) { s t r c p y ( n ame , nm ) ; s t r c p y ( p h n o , t e l n o ) ; } } ; v o i d p h o n e B o o k : : g e t d a t a ( ) { c o u t < < " n E n t e r N ame : " ; c i n > > n ame ; c o u t < < " E n t e r P h o n e N o . : " ; c i n > > p h n o ; } v o i d p h o n e B o o k : : s h o wd a t a ( ) { c o u t < < " n " ; c o u t < > nm ; f i l e . s e e k g ( 0 , i o s : : b e g ) ; f o u n d = 0 ; i n t c n t = 0 ; wh i l e ( f i l e . r e a d ( ( c h a r * ) & r e c { c n t + + ; i f ( s t r c mp ( nm , r e c . g e t n ame ( ) { f o u n d = 1 ; b r e a k ; } } f i l e . c l e a r ( ) ; i f ( f o u n d = = 0 ) c o u t < < " n n - - - R e c o r d N o t f e l s e { i n t l o c a t i o n = ( c n t - 1 ) * s c i n . g e t ( c h ) ; i f ( f i l e . e o f ( ) ) f i l e . c l e a r ( ) ; c o u t < < " E n t e r N e w T e l e p h o n e c i n > > t e l n o ; f i l e . s e e k p ( l o c a t i o n ) ; r e c . u p d a t e ( nm , t e l n o ) ; f i l e . w r i t e ( ( c h a r * ) & r e c , f i l e . f l u s h ( ) ; } b r e a k ; c a s e 6 : g o t o o u t ; } } o u t : f i l e . c l o s e ( ) ; } [ / C o d e ]