Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2369 views
1
#include "randalpaca.h"
2
#include "randPack.h"
3
#include "alpaca.h"
4
#include <sstream>
5
6
static int packNum = 0;
7
8
9
randPack::FracasPack::FracasPack()
10
{
11
std::ostringstream os;
12
13
//give the packa a unique name
14
os << "Random Pack " << packNum++;
15
packName=os.str();
16
17
//pack up 6 randals!
18
for(int i=0; i<6; i++) {
19
//name and load a randal
20
os.str(""); //reset
21
os << "Randal #" << packNum-1 << "-" << i;
22
load(new Randalpaca(os.str(), this));
23
}
24
}
25
26
27
std::string
28
randPack::FracasPack::name()
29
{
30
return packName;
31
}
32