In this program you will have to implement a simple phonebook application.
1. Make a program that reads from standard input a name (no spaces allowed) and a phone number (again no space allowed), and that stores them in the tree, sorted on the name. When the name that your program reads is a "." , then you should stop building the tree, and ask for a name. Your program should then find the name in the tree and print the phone number, or "NOT FOUND" if there is no phone number. You should keep asking for a name until another "." is entered. For example:
% a.out
Muller 01179545137
Lewis 01179545138
BR 0845484950
NASA +19876543210
.
Type a name please BR
0845484950
Type a name please Lewis
01179545138
Type a name please BR
0845484950
Type a name please .
%
(Note: the Bold text is text that is printed by your program, all the other text is text that I will type when trying your program. The % a.out line is just for completeness - the % stands for the command prompt, your program binary may be called a.out). (Note: if there is no bold text above then please adjust your set).
Upto 40%
2. Change the program so that it ignores the case when it looks up the name (Ie, it will find "lewis", "LEWIS", "Lewis" etc)
Upto 55%
3. Change the program so that if a name is entered more than once (Ie, a person has more than one phone number), all phone numbers are printed when the name is entered.
Upto 70%
4. Change the program so that it stores a list of phone numbers for each name. So the nodes of a tree have a list hanging of the leafs. Your program must print out `100%' on the first line.
Upto 100%