我今年在英国读大一.以前对C语言没有研究,无奈的是我们今年有这一项科目~更无奈还是用英语学习,下面这个题是最近的一个作业,希望有兴趣C语言高手能帮忙指导一下!帮忙暂时度过此难关,菜鸟在此感激不尽...
You are required to write a database program in C. The program should store the following details for each person:
Name
Address
Telephone number
E-mail address
On start-up the program should ask the user how many sets of details you want to store, and then allocate the appropriate space to store them. The user will then be presented with a menu of options as follows:
1. Enter data
2. Edit data
3. Delete data
4. Display data
5. Save data
6. Load data
7. Quit
Select an option (1-7):
Consider the following:
When entering data the program should allow the entry of a single persons details that will be added to the current data. The user should then be questioned “Enter more details (Y/N) ?”, so that additional details can be added or the user can be returned back to the menu.
All the data that space is allocated for does not need to be entered in one go. Imagine a golf club using your software as a customer database. All the customers are not going to join at once. Therefore the first time option 1. is chosen the program should say something like “Enter the details for customer 1”, and so on as the database is filled.
The delete/edit options should deal with deleting/editing a single persons details at one time.
If the user inputs that he/she wants 20 sets of details, the program should not allow more than 20 sets to be entered. A warning that the space is full should be included in your program.
You should clearly demonstrate use of the following features or concepts within your program:
1. A menu
2. Structures
3. File handling
4. Dynamic memory allocation
Additional marks will be given if a sorting algorithm is used to sort the entered data alphabetically, based upon the name entered. This could be added as an option from the menu. Further relevant options can be added if you feel the need.