代写C代码 代做C程序 C辅导 C家教

远程写代码 Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

 

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%

 

相关推荐