Question: In C++ develop a simple database system. The database is to handle multiple records, each composed of several fields. The database will store its information
In C++ develop a simple database system. The database is to handle multiple records, each composed of several fields. The database will store its information to a file, addition and deletion of records, field modifications, and it will allow users to sort records based on the selected keys, and produce reports (output) according to predefined criteria.
The database is to handle multiple records, each composed of several fields. The database will store its information to a file, addition and deletion of records, field modifications, and it will allow users to sort records based on the selected keys, and produce reports (output) according to predefined criteria.
Some definitions:
A database is a collection of information, or data, that you can organize, update, sort, search through, and print as needed. A database does not just hold information; you use a database to organize and analyze information so that you understand its significance.
A database file consists of one or more records. Each record holds all the information about one subject item. In C++, the class data type provides an efficient way to represent and manipulate records.
Each piece of information in a record is called a field. Fields store the data that has been entered or calculated. In C++ parlance, fields are nothing more than the member variables defined for a particular class.
Given the requirements as a rough specification, you're supposed to design the class and implement the database. So you can consider the requirements below as an outcome from a meeting with a client. You are in full control of the choice of data structures (except the main data structure of AVL tree, more detail below), algorithms, internal file format, and detailed user interface scheme.
You're designing and implementing a database for an address book. Users should be able to browse, search their contacts, by any field (last name, first name, zip code etc.) from the database, and organize their chosen contacts to their liking and print out a report. Each contact information includes followings:
Unique ID number. ID is a 9 digit number
First name
Middle name (or initial)
Last name
Company name
Home phone
Office phone
Mobile number
Street address
City
State
Zip code
Country
List of affiliates (such as family members or associates name). Each affiliate has first name, and last name. They may have one individual mobile phone number and one email. Note that all affiliates will share the rest of the contact info, and you need to make sure that the shared info is not duplicated. The total number of affiliates is unknown.
Requirements
Database overall management
Use a text based menu for users to choose available features. Program should have a main menu at the beginning and sub menus depending on the task.
You should allow users to read and write data to a text-based database file. The format of the text-based database file is following:
All information is stored in ASCII text format.
Records are divided by a | character
Each field is distinguished by a new line.
Submit a sample data file with at least 50 records. (Let's post at least 10 contacts (not necessarily real personal info, imaginary contacts) on the final project Q&A and share)
When reading from a data file, your program must test the input file to ensure that data is of valid format (basic error detection).
The database is primarily organized with the ID# as a key. You have to useAVL tree for the base data structure.
Each component of the overall program should be fairly modular.
Each menu item, for example, should be a separate function. The menu feature should be handled by a separate function and not by main( ).
Program should be fairly fault tolerant of user input (both when the user is entering data, and making menu choices). Provide appropriate user prompts and on-screen directions
Split the program into multiple files based on the roughly categorized functionality.
Data Retrieval and Modification
Users should be able to search records based on the field information in two modes: exact and contains. For example, search contacts by last name "Smith", search contacts with an email domain name that contains "ucdenver", etc. So in the search sub menu, users have to pick the search mode and field. Of course users should type in the search item.
Quite often, search may generate a relatively big output. Users should be able to search again within the search result (secondary search) or start all over again from scratch (new search).
Since the entire data is structures in a AVL tree with the ID# key, any search (except using ID#) should traverse the entire tree.
Users should be able to delete a record. So, in the delete record sub menu, users should be able to search and pick a delete candidate record. After deletion, the AVL tree should be rebalanced.
Users should be able to modify fields in a record, with the same condition above.
Users should be able to insert new records. There should be no restriction to the number of records in the database. So, in other words, you should not consider a fixed array for the record data structure.
Users can modify records, so the user should be able to write back to file (overwrite to current file or to a new file name similar to "save as").
Output Generation
Output generation is responsible for the re-organizing the final result to a user's liking by displaying appropriate fields and sorted records. The final output is a report in ASCII-text format.
After a series of data retrieval and modification, finally there is a list of contacts to be an output. Users should be able to further organize the contact and convey them to the output by choosing only the fields they want to print in desired order. So users should be able to pick fields to be finally shown in the output. And users should be able to sort the final output contacts by selecting a field as a key.
Users should be able to perform a secondary sorting with the second sort key (e.g., sort by company name, and then last name).
Output file generation in text file format.
Users should be able to generate a report output in ASCII text format. Note that this output file is different from the database file in ASCII text format.
Keep in mind that an output may not include all fields and records.
Submission Guideline
You need to submit following items (all zipped together):
Source code with reasonable comments
Makefile that works (and is tested) on the csegrid.
A final report that includes:
Summary of provided functions. This should be matched with the requirements
Accurate status of the program, what's done, and what's not completely implemented.
Accurate status of testing on the csegrid.
The final report should be in MS Word, or PDF format.
Note: You must use the following AVL code for your AVL tree. You may not use every function associated with this code. You should not need to change this code, but you will need to read it to see something that is included that may need to be added.
avlnode.cpp

avlnode.h

avltree.cpp

avltree.h

bstnode.cpp

bstnode.h

bstree.cpp

bstree.h

itemtype.h

and then a driver file to show you how to use these files:
avltest.cpp

Grading Criteria
Submitting a working program that provides all of the required features will result in a maximum grade of 80%.
Documentation explained above will result in 20% of the grade.
Any or all of the following will result in point deductions of up to 5% foreach infraction.Poor and/or inconsistent programming style. This includes the following:
Improper use of indentation.
Overuse of global variables.
Failure to keep functions modular and reusable (possibly applicable to other programs).
Insufficient comments.
Insufficient menu prompts
Program is not reasonably( not absolutely) fault tolerant.
Test to ensure that your program cannot be crashed or sent into an infinite loop by a user who is not following directions.
Submitting a program that does not compile on csegrid.ucdenver.pvt may result in a deduction of at least 30%. Additional points will be lost for each required feature that is not adequately addressed.
THANKS!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
