You are to develop a software solution to the problem facing a local business. The business has a paper-based customer database to be converted to computer. It must be possible to interactively enter new customers, modify existing customer entries and delete customers. A reports section must produce a list of customers in alpha order of name. The system should be menu-driven with options as follows:

1    Add new customer
2    View customer details
3    Modify customer record
4    Delete customer
5    Reports
6    Exit

Customer records are to consist of: customer number, customer name, address details. The records are to implemented as structures and held in an array. You will be given a file customer.h which contains the code for this. The file is to be included at the top of your program using a #include <customer.h> statement. YOU MUST USE THIS FILE. Pay close attention to the contents of this file and DO NOT modify the structures or variables in it. Once this is included you do not need to declare the structures or array in your program. To do so would be a mistake since you would then either be re-declaring them or using something different. The purpose of this is to allow easy testing of the programs submitted.

In order to view, modify or delete customers you will need to write a search function which locates the record. Assume all customers have unique names i.e. there are no duplicates in the array. Any type of search is acceptable. You may choose to keep the customer database in sorted order or you may sort it when reports are required. Any type of sort is acceptable. Reports are on-screen only and should be able to be paged through i.e. you will have to work out how many records fit on a screen. Note your program will not save any additions, deletions etc, they will be lost upon exit from the program.

Marking

To obtain a pass grade your program must have a working menu and be capable of adding a new customer, finding a record, viewing a record, modifying one customer record correctly and deleting one customer record correctly. To obtain higher grades the program must handle any number of  new or deleted customers and produce correct sorted reports.

Optional extra

If you wish to implement the program using classes and objects this will result in a high grade if all functionality as specified works correctly. To do this you will have to modify the supplied customer include file. This is optional and not in any sense required or expected. Do not attempt this unless you are confident of success. A poor attempt will result in a low grade.

Customer.h file

const SIZE = 10;
struct Address {
  char Street[20];
  char Suburb[20];
  char State[4];
  char PostCode[5];
};
struct CustomerRec {
  long CustNum;
  char CustName[20];
  Address CustAddr;
};
CustomerRec CustDB[SIZE]= { {123456, "Chans Plumbing", "63 Ninth Ave", "Toongabbie","NSW","2560"},
{24687, "Zhangs Joinery", "5 Dumfries Rd", "Randwick", "NSW", "2243"},
{54321, "Woos Garden Shop", "171 Rochford Street", "Penrith", "NSW", "2370"}};

我的邮箱hiscal@126.com