Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WelcomeLetter.h #pragma once #include Observer.h #include Customer.h class WelcomeLetter : public Observer { public: WelcomeLetter ( void ) ; void update ( Customer
WelcomeLetter.h
#pragma once
#include "Observer.h
#include "Customer.h
class WelcomeLetter : public Observer
public:
WelcomeLettervoid;
void update Customer myCust;
public:
~WelcomeLettervoid;
;AddrVerification.cc
include "AddrVerification.h
#include
using namespace std;
AddrVerification::AddrVerificationvoid
AddrVerification::~AddrVerificationvoid
void AddrVerification::update Customer myCust
do Address verification stuff here
can get more information about customer
in question by using myCust
coutin AddrVerification update"
using namespace std;
Customer::Customervoid
Customer::~Customervoid
void Customer::attach Observer myObserver
myObs.pushback myObserver;
void Customer::detach Observer myObserver
for int i; i myObs.size; i
if myObsi myObserver
myObs.erasemyObsbegini;
return;
void Customer::notifyObs
set arg to something that helps
tell the Observers what happened
for int i; i myObs.size; i
myObsiupdatethis;
string Customer::getState
string state new string;
set state
return l;
Customer.h
#pragma once
#include
#include
#include
#include "Observer.h
using namespace std;
class Customer
public:
Customervoid;
void attach Observer myObserver;
void detach Observer myObserver;
string getState;
void notifyObs;
private:
vector myObs;
public:
~Customervoid;
;
CustomerTest.cc
#include "Observer.h
#include "Customer.h
#include "AddrVerification.h
#include "WelcomeLetter.h
#include
int main
Customer customer new Customer;
WelcomeLetter wl new WelcomeLetter;
AddrVerification av new AddrVerification;
customerattachwl;
customerattachav;
customernotifyObs;
cin.get;
Observer.cc
#include "Observer.h
Observer::Observervoid
Observer::~Observervoid
Observer.h
#pragma once
class Customer;
class Observer
public:
Observervoid;
virtual void update Customer myCust;
public:
~Observervoid;
;
WelcomeLetter.cc
#include "WelcomeLetter.h
#include
using namespace std;
WelcomeLetter::WelcomeLettervoid
WelcomeLetter::~WelcomeLettervoid
void WelcomeLetter::update Customer myCust
do Welcome Letter stuff
here can get more
information about customer
in question by using myCust
coutin welcome letter update" endl WelcomeLetter.h
#pragma once
#include "Observer.h
#include "Customer.h
class WelcomeLetter : public Observer
public:
WelcomeLettervoid;
void update Customer myCust;
public:
~WelcomeLettervoid;
;
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