#include "Interface.h"
#include <iostream>
using namespace std;
int main()
{
cout<<2;
Interface *i1=new Interface();
return 0;
}
using namespace std;
Interface::Interface()
{
numberOfCenters=0;
numberOfChains=0;
Chains=NULL;
Centers=NULL;
cout<<-3;
addCenter("Hilel",212);
cout<<-4;
addCenter("Hasharon",432);
cout<<-5;
addChainClothing("Bastro","Moshe");
cout<<-6;
addChainFood("Columbus",3);
addChainFastFood("George",3,25,35);
cout<<-1;
addChainBook("Shuper","C++ programming is fun");
cout<<-2;
Chains[0]->addShop(2);
Chains[1]->addShop(12);
cout<<0<< endl;
Chains[2]->addShop(43);
cout<<1<< endl;
Chains[3]->addShop(65);
cout<<2<< endl;
cout<<"Finished initializing"<< endl;
Centers[0]->addChainToMall(Chains[0]);
Centers[0]->addShop(Chains[0]->getShop(2));
cout<<3<< endl;
Centers[0]->addChainToMall(Chains[2]);
Centers[0]->addShop(Chains[2]->getShop(43));
cout<<4<< endl;
Centers[1]->addChainToMall(Chains[1]);
Centers[1]->addShop(Chains[1]->getShop(12));
cout<<5<< endl;
Centers[1]->addChainToMall(Chains[3]);
Centers[1]->addShop(Chains[3]->getShop(65));
cout<<6<< endl;
menuManager();
}
void Interface::addCenter(const char* name,int number)
{
int j,place;
if(findCenter(name,number)==-1)
{
place=findPlaceNewCenter(number);
Center** tempo=Centers;
Centers= new Center* [++numberOfCenters];
for (j=0;j<numberOfCenters-1;j++)
if(j!=place)
Centers[j]=tempo[j];
Centers[place]= new Center(number,name);
delete []tempo;
}
else
cout<<"not unique error"<< endl;
}

New Topic/Question
Reply



MultiQuote



|