Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Linux Need help with lab assignment Create using PersonData.h and CustomerData.h INSTRUCTIONS: CODE: #include #include PersonData.h #include CustomerData.h using namespace std; int main() {

C++ Linux

Need help with lab assignment

Create using "PersonData.h" and "CustomerData.h"

INSTRUCTIONS:

image text in transcribed

CODE:

#include

#include "PersonData.h"

#include "CustomerData.h"

using namespace std;

int main() {

PersonData P1;

P1.setName("Junyi", "Tu");

P1.setAddress("1101 Camden Ave.", "Salisbury", "MD", "21801");

P1.setPhone("410-677-0027");

P1.PrintRecord();

cout

cout

cout

PersonData *P2 = new PersonData();

P2->setName("John", "Doe");

P2->setAddress("Nowhere Ave.", "Podunk", "NB", "66666");

P2->setPhone("123-456-7890");

P2->PrintRecord();

cout

cout getRecord()

cout

CustomerData *P3 = new CustomerData();

P3->setName("Jane", "Doe");

P3->setAddress("Nowhere Ct.", "Podunk", "NB", "66666");

P3->setPhone("987-798-1111");

P3->setCustomerNumber(12345);

P3->setMailingList(false);

P3->PrintRecord();

cout

cout getRecord()

cout

PersonData *costumers[5];

costumers[0] = P2;

costumers[1] = P3;

for (int i = 0; i

costumers[i]->PrintRecord();

cout

}

delete P2;

delete P3;

P2 = nullptr;

P3 = nullptr;

return 0;

}

Design a class named PersonData with the following member variables: - lastName - address ptate phone - firstName - city zip 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. 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. In particular, both classes should have the functions PrintRecord and getRecord. Neither should take any parameters. The PrintRecord will print the data to the console in a nice format, example is below. The getRecord function will return a string of the data with each field separated by a "/", example below. Also, these two functions must be set up for dynamic binding. The CustomerData class should call the PrintRecord and getRecord functions from the parent class to do its portion of the printing or string creation, you do not want to rewrite the code you already wrote for the base class. Create the following main and run it with your classes. The output is below the main code

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

More Books

Students also viewed these Databases questions

Question

5. Efforts to streamline HRM processes.

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago