Question: Help to fix this program! Lottery.h ***************************************************************************** #ifndef LOTTERY_H #define LOTTERY_H #include #include #include #define SIZE 5 #define MAX_RANGE 10 #define MIN_RANGE 5 using namespace
Help to fix this program!

Lottery.h
*****************************************************************************
#ifndef LOTTERY_H #define LOTTERY_H #include
#define SIZE 5 #define MAX_RANGE 10 #define MIN_RANGE 5 using namespace std;
class Lottery { protected: int lottery[SIZE]; public: Lottery(); ~Lottery(); virtual void intro(); virtual void generateNumbers(); int findMatches(Lottery &) ; friend ostream &operator>(istream &, Lottery &); bool operator==(Lottery &); };
#endif
Lottery.cpp
**************************************************************************
#include
Lottery::Lottery(){} Lottery::~Lottery(){}
void Lottery::intro() { cout
void Lottery::generateNumbers() { srand((unsigned)time(NULL)); for (int i = 0; i
int Lottery::findMatches(Lottery &obj) { int matches = 0; for (int i = 0; i
ostream &operator
istream &operator>>(istream &is, Lottery &obj) { for (int i = 0; i > temp; while (is.fail() || (int)temp != temp || temp 9 || getchar() != ' ') { cout ::max(), ' '); is >> temp; cout
bool Lottery::operator==(Lottery &right) { for (int i = 0; i
SuperLoto.h
***************************************************************************
#ifndef SUPERLOTO_H #define SUPERLOTO_H #include
class SuperLoto : public Lottery{ protected: int superLoto; public: void intro(); void generateNumbers(); }; #endif
SuperLoto.cpp
********************************************************************
#include
void SuperLoto:: intro() { cout
void SuperLoto::generateNumbers() { srand((unsigned)time(NULL)); superLoto = 0 + rand() % MIN_RANGE; cout
Main.cpp
*****************************************************************************
#include
int main() { for(bool reRun = true; reRun != false;) { char choice; //create an object Lottery player, automate; SuperLoto super; // virtual function call through reference Lottery& playerR = player; // the type of playerR is Lottery* Lottery& superR = super; // the type of superR is Lottery* as well automate.generateNumbers(); // generateNumbers base class super.generateNumbers(); // generateNumbers dervived class
int numMatches; // Number of matches player.intro(); // prints base class super.intro(); // prints dervived class
cin >> player; cout
numMatches = player.findMatches(automate); cout
if (player==automate) cout > choice; cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
