Posted on 2004-03-22
hi, can u pleae help me with this program im tryin to solve, im an dead stuck, below i have stated the specifcation:
My task is to develop a text-based menu driven electronic organiser application As well as its normal functions, it must also create a text file of specific records with appropriate fields for transfer of contact details to a mobile phone.
im am required to use a menu based system in the layout below:
1) The menu.
The menu structure will contain the following entries
• Create an entry
• Amend/Delete an entry
• Search for an entry
• Create mobile phone transfer file
• Quit the application
Below i have listed the file processing specification for the program:
2) File Processing
Upon execution the application will ask for the name of the ‘master file’, which will then be supplied by the user. All of the records in the master file will then be read into an array before any other processing will occur. Upon the user asking to ‘Quit’ the application, the user will be asked if the master file should be updated, but only if records have been created/amended and/or deleted. The structure of a master file record is as follows:
Surname Firstname Address_Line_1 Address_Line_2 Address_Line_3
Postcode Home_Number Mobile_Number Email_Address Mobile_Indicator
Each field is separated by a space and the same code given in the lectures will also allow each record to be separated by a new-line ‘\n’ character so it will be easy to create a file of test data in an editor. One problem you will have is the presence of ‘ ‘ space characters in some of the fields. You should assume that all fields could hold space characters and when writing out the master file replace all spaces with a field with the ‘_’ underscore character and when reading it in, replace all ‘_’ underscore characters within each field with a ‘space’ character.
When asked to generate a mobile phone transfer file, the program will ask the user for a filename, which will then be used to save the transfer data in. Only the records with the ‘Mobile_Indicator’ set to ‘true’ will be transferred to the transfer file and only the following fields will be transferred for each of those records:
The ‘Person_ID’ is made upon of the ‘Firstname’ and ‘Surname’ fields concatenated together with the word ‘Mobile’ or ‘Home’ appended if the ‘Mobile_number’ field or ‘Home_Number’ field is used. Each part of the ‘Person_ID’ field will be separated by an ‘_’ underline character. If a master record has data in both numbers then two transfer records should be created. One for the mobile number and one for the home number. Example, one record with the mobile number will be:
The program also has to be able to search, I have listed the search specification below:
3) Internal Record Processing
Creating a record will simply mean adding a new record to the next empty element of the master array. You should use the ‘strupr’ function from the <string.h> library, which will convert all characters in a string to uppercase. If you do this for all user input for record fields then this will make searching for a record easier. Use the IDE help system to find out more about the function. Deleting a record will mean moving all the records that follow the record to be deleted up an element so that the record to be deleted is over-written by the next record and so on. You should store a record in the array as a ‘struct’ so that you can easily access all of the fields separately.
Searching should be allowed on the following fields:
Surname, Post-code and/or Email Address
I would much appreciate it you could help me, thanks