Rate this paper
  • Currently rating
  • 1
  • 2
  • 3
  • 4
  • 5
5.00 / 2
views 1410 | downloads 811
Paper Topic:

Introduction to Algorithms and Programming

name ID include include include

int n , m 1 , x 0

char book[1000][75]

char fname[25] ,lname[25] ,tel[25]

char choice

searchcustomer

char schoice

char slname[25]

char stel[25]

int y 0

clrscr

printf "1 )Search by Last Name\n2 )Search by telephone

scanf ( c ,schoice

if (schoice 1

printf ( Enter Last Name

scanf ( s slname

if (slname '0

while (y n

if (slname book[y][0]

printf ( \n s s s ,book[y][0] ,book[y][25] ,book[y][50]

y y 1

if (schoice 2

printf

( Enter Telephone

scanf ( s stel

if (stel '0

while (y n

if (stel book[y][50]

printf ( \n s s s ,book[y][0] ,book[y][25] ,book[y][50]

y y 1

return (0

main

clrscr

printf ( Enter the size of the database (1 to 1000

scanf ( i n

while (n1000

printf ( Number out of range !\nEnter new size

scanf ( i n

while (x n

printf ( Enter Last Name of Customer i ,m

scanf ( s lname

book[x][0] lname

printf ( \nEnter First Name of Customer i ,m

scanf ( s fname

book[x][25] fname

printf ( Enter Phone Number of Customer i ,m

scanf ( s tel

book[x][50] tel

m m 1

x x 1

clrscr

printf ( Make a search ? Y /N

scanf ( c choice

while (choice "Y choice "N choice "y choice "n

printf ( Invalid Input !\nMake a search ? Y /N

scanf c choice

while (choice "Y choice "y

searchcustomer

printf ( Enter Y to search again . Enter any other key to exit

scanf c choice

getch

return (0...

1 pages
28.0 KB
Free sing-up

Not the Essay You're looking for? Get a custom essay (only for $12.99)