Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a class named PersonData with the following member variables: lastName firstName address city state zip phone Write the appropriate accessor and mutator functions for

Design a class named PersonData with the following member variables:

lastName

firstName address

city

state

zip

phone

Write the appropriate accessor and mutator functions for these member variables.

Next, design a class named CustomerData, which is derived from the PersonData class. The CustomerData class should have the following member variables:

customerNumber

mailingList

The customerNumber variable will be used to hold a unique integer for each customer and you must manage the uniqueness of this variable using a static member variable. The mailingList variable should be a bool. It will be set to true if the customer wishes to be on a mailing list, or false if the customer does not wish to be on a mailing list. Write appropriate accessor and mutator functions for these member variables.

Demonstrate, in a simple printing program, a dynamically allocated array of objects from the CustomerData class, where customer data should be read from a file and then assigned using a set() member function of the object. Once all data is read and the array is populated, the program should print out using get() member function, all the info for customers that would like to be included in the mailing list. A Sample text file CustomerInfo.txt should be included with this document. CustomerInfo just needs to be included within the code so it gathers the data from the file.

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago