Question
Hi, can someone help me with this? I don't need a perfect code just a working code to start with. The example picture is provided
Hi, can someone help me with this? I don't need a perfect code just a working code to start with. The example picture is provided below on how it suppose to look like. Please try your best to help me with this thanks. Please don't skip my question. It really means a lot thanks.
USER-INTERFACE
Create user_interface.c and implement your user-interface.
Define the following item in the main function:
and pass it or its address to the database functions.
MENU
The transactions must be formatted in this form.
- Display an introductory message at the beginning.
- Display instructions for the menu and the menu options.
- The user must be able to specify the menu option by typing the option name (menu options to implement are listed below).
- If needed for the selected menu option, collect the appropriate information from the user (e.g., account # etc).
- Display the results
- Unless the user chose to quit the program, display the menu and ask for a menu option again.
The following menu options must be available:
- add: Add a new record in the database
- printall: Print all records in the database
- find: Find record(s) with a specified account #
- delete: Delete existing record(s) from the database using the account # as a key
- quit: Quit the program
The program must allow the user to type partial or full option name (listed above) to choose an option.
- For example, if the user gives a or ad, the program must accept it as an option for add, BUT it must reject invalid word starting with the command such as adding, address, etc.
- To check what the user typed for the menu option, use at least one function declared in string.h.
- If the user gives invalid option name, display an error message and ask for a valid menu option (it must not exit!)
- Except for quit option, a menu option must call the corresponding database function with the appropriate user input.
- You must use a while or do-while loop for the menu.
USER INPUTS
Each record contains the account number (int), name (char [ ]), and mailing address(char [ ]) fields.
- The account number must be positive (> 0).
- The name field must accept a string containing white spaces, i.e., it allows all characters until it sees a newline character.
- For example, "Ravi", "Tetsuya", "Dr. Dennis Ritchie", "John F. Kennedy Jr.", "Elizabeth the 1st" and so on.
- You can deal with symbols like "#", "$", etc as regular characters.
- Write the 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 going to type
- You CANNOT ask if the user wants to fill another line while he/she is typing
- You CANNOT ask if the user wants to type one more line during typing.
- Prototype for the function is
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