In: Computer Science
Task 1:
Implement the constructor for the Hostess struct. It must initialize all member variables, including any arrays. There is another function that performs initialization. You must change the program so that the object’s initialization is done automatically, i.e. no explicit call is needed for an initialization function.
#ifndef HOSTESS_H #define HOSTESS_H #include "Table.h" #include <iostream> struct Hostess{ void Init(); void PlaceArrivalInQueue(int arrivals); void ShiftLeft(); void Print(int hour, int minute, int arrivals); int GetNumTables(){return numTables;} int Seat(int table, int time); int CheckAvail(); int totalServed; int currentCustomers; int queue_size; int numTables; Table tables[30]; int queue[15]; }; #endif // HOSTESS_H
#ifndef HOSTESS_H
#define HOSTESS_H
#include "Table.h"
#include <iostream>
struct Hostess{
void Init();
void PlaceArrivalInQueue(int arrivals);
void ShiftLeft();
void Print(int hour, int minute, int arrivals);
int GetNumTables(){return numTables;}
int Seat(int table, int time);
int CheckAvail();
int totalServed;
int currentCustomers;
int queue_size;
int numTables;
Table tables[30];
int queue[15];
public:
Hostess(int totalServed,int currentCustomers,int queue_size,int numTables,int queue[])
{
this->totalServed=totalServed;
this->currentCustomers=currentCustomers;
this->queue_size=queue_size;
this->numTables=numTables;
for(int i=0;i<15;i++)
{
this->queue[i]=queue[i];
}
for(int i=0;i<30;i++)
{
this->tables[i]=Table();
}
}
};
#endif // HOSTESS_H
int main()
{
}