Question
Write a user-interface which allows the user a menu of choices for a bank database application. The database contains the accountnumber (int), name (char [
Write a user-interface which allows the user a menu of choices for a bank database application. The database contains the accountnumber (int), name (char [ ]), and address(char [ ]) fields for each person.
Requirements
Menu Options
Assume that the information is stored in a database which is a black box and can only be accessed by the functions, addRecord, modifyRecord, printRecord and deleteRecord, which have the following prototypes:
int addRecord (struct record **, int, char [ ],char [ ]); int printRecord (struct record *, int); int modifyRecord (struct record *, int, char [ ]); // This should modify the address field void printAllRecords(struct record *); int deleteRecord(struct record **, int);
Do not implement or complete the above functions
The following menu choices must be available:
Add a new record in the database
Modify a record in the database using the accountno as the key
Print information about a record using the accountno as the key
Print all information in the database
Delete an existing record from the database using the accountno as a key
Quit the program
You must use a while or do-while loop for the menu.
For each menu option, collect the appropriate information from the user (including an account number).
User Inputs
Write your own getaddress function to obtain the address information
the address field may have multiple lines of address
It must be stored as one character array
You CANNOT ask the user how many lines of address they are typing
Prototype for the function is void getaddress (char [ ], int);
The name entered by the user may have spaces.
Source Files
struct record { int accountno; char name[25]; char address[80]; struct record* next; };
Stubs for the above five functions must be defined in a separate file.
All stubs must be in one source file and the user-interface functions in one or more files.
DO NOT DEFINE a structure or array to hold the entire database, but using the following structure as a separate, record.h file
Define:
struct record * start; start = NULL;
and pass it/its address to the database functions.
Basically I only need help writing the getaddress function.
the langauge is C.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started