Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ coding program to process a contact list of friends and business contacts. There are three milestones in this assignment. The deliverable of

Write a C++ coding program to process a contact list of friends and business contacts.

There are three milestones in this assignment. The deliverable of each milestone is a C++ program. You are allowed to use only C++ standard libraries except in your programs.

Milestone 1

Write a program which processes the contact information of friends. The data fields of a friend object are name, address and personal phone number. Implement a Friend class and use a vector or a static array to store the Friend objects. If you use a static array, assume the maximum number of Friend objects to store in the array is 50.

The features required are:

1. Insertion of a new object

2. Modification of a data field in the object

3. Deletion of an object

4. Listing all friends on screen, displaying all the data fields.

5. Sorting of the list of friends in ascending or descending order based a data field.

6. Displaying friends which contain a certain text string specified by the user in a data field.

7. Saving the data of all Friend objects into a text file

8. Loading the data of all Friend objects from a text file

Design your own user interface to facilitate the features above. The program should check and ensure that only valid data are entered into the record. Assume that when the user is required to enter a number, the user will not enter text characters.

For marking purpose, prepare a sample data of at least 10 Friend objects in a text file for loading into the program.

Milestone 2

Implement a BusinessContact class, duplicate the program from milestone 1 and modify it to process BusinessContact objects instead of Friend objects. The data fields of a business contact are name, address and company.

Milestone 3

Implement a Person class which has two data fields, name and address, and the following pure virtual functions.

display : to display all data fields

modify : to modify a data field

~Person : to enable dynamic binding on the destructor

Implement a Friend class which inherits from the Person class and overrides the virtual functions in the Person class.

Implement a BusinessContact class which inherits from the Person class and overrides the virtual functions in the Person class.

Modify the program in Milestone 1 to store the (pointers to) Friend objects and the (pointers to) BusinessContact objects in one vector or one static array. The program will process both Friend objects and BusinessContact objects together making use of the concept of polymorphism. It will have all the features from feature 1 to feature 8 listed in Milestone 1 with the following exceptions.

a. Feature 5 only needs to support sorting by name.

b. Feature 6 only needs to filter by either name or address each time this feature is invoked.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

describe the main employment rights as stated in the law

Answered: 1 week ago