Click here to Skip to main content
15,359,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have never written a pseudo code or any Algo , so I don't know how to write a pseudo code of a telephone directory , I have always written the Codes, am done with the coding , please somebody help me in writing the pseudo code of a telephone Directory. Kindly tell me please
Posted
Comments
Yuri Vital 24-Oct-11 9:54am
   
Not clear. What is a telephone Directory ?
Rob Philpott 24-Oct-11 10:17am
   
It's a thing with lots of names and phone numbers in it. You can find someone's phonenumber by finding their name and looking at the number next to it.

1. collect everybody's phone number, address, and the name they wish to be listed under; perhaps an option is not to have any address listed ?

2. create a relational database where the phone number functions as UniqueID. create the tables and links between tables so that given any one of the three pieces of information you can easily query the database for the other corollary information

2.a. create a user interface for entering the data collected in step #1 in such a way that each type of data item is validated, and, of course, sorted properly. the functioning of this program to be determined by the data-entry method in step #3,

3. enter the data via ocr/automation, or manual entry by low-paid wage-slaves.

4. create a custom program that iterates the entire database and generates a pdf file which you then can send to your printer.

5. create a custom client user interface for authorized persons who have security clearance to look up information in the database. create custom security procedures for emergency or police queries.

6. figure out how much money has been allocated for this project.

7. submit a bill for 250% more than the amount allocated, and then negotiate the final payment down to 150% or so.
   
What aspect of a phone book?? There is no pseudo code for a table.

You might want to start by reading these: "What is psuedo code"[^]
   
Comments
Mehdi Gholam 24-Oct-11 10:04am
   
A good place to start, 5!
zahra1991 24-Oct-11 10:19am
   
i mean to say a telephone directory ... if we want search by name , adreess, or by phone number
Dave Kreskowiak 24-Oct-11 15:45pm
   
Then the only thing you're writing psuedo code for is to search the database, probably something like an indexed search or a binary search. Writing for adding or removing or updating entries is trivial.
A telephone directory isn't algorithmic so you can't write code for it. It would be a data structure on a computer. You could write code to access it, add to it etc., but that's different.

Pseudo code is just abbreviated code, written in plain English (or whatever language you're comfortable in). Stuff like simple functions, iterations, if-then type logic, to demonstrate the process without the computer language detail filled in.
   
C#
var table(contacts)
//create a new contact
contact c = new contact(name, phone number)
//add to table
table.add(c);
//search for a contact
contact c1 = table.find(name)
//remove contact
if ((contact cr = table.find(name))!= null)
{
   table.remove(cr)
}
//update contact
contact cx = table.find(name)
cx.name = "newname"
cx.phonenumber = newnumber
table.save(cx)


This should give you a rough idea of what and how of writing psuedo-codes for your problems. This is no programming language but just abstract pseudo-English statements describing the data and operations.

Cheers..
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900