It also mentions line 932 which does not exist nor has it existed previously. I have tried to find out the reason for this error but cannot work it out.
Any help would be great thanks.
#include <iostream>
#include "cstdio"
#include <cctype>
#include <ctime>
#include <string>
#include <vector>
using namespace std;
class Allveh {
public:
Allveh() :
dg(0),
id(),
carry()
{}
int dg;
char id;
char carry;
};
class Struck : public Allveh {
public:
Struck()
{
dg = 3;
id = 's';
carry = 'n';
}
};
class Svan76 : public Allveh {
public:
Svan76()
{
dg = 3;
id = 'h';
carry = 'n';
}
};
class Xveh {
public:
Xveh() :
dg(0),
id(),
carry()
{}
int dg;
char id;
char carry;
};
class P3van : public Xveh {
public:
P3van()
{
dg = 4;
id = 'p';
carry = 'n';
}
};
vector<Allveh> allvector;
vector<Allveh>::iterator it;
vector<Xveh> xvector;
vector<Xveh>::iterator iter;
int allCreator(Allveh& unit)
{
int num;
cout << "Enter 1-3 vehicle objects to put into vector.\n";
cin>> num;
for (int i = 0; i<num; i++)
{
allvector.push_back(unit);
cout <<"Issue Idtag = "<< allvector.size()-1<<" to those objects."<<endl;
}
return 0 ;
}
int xCreator(Xveh& unit)
{
int num;
cout << "Enter 1-3 vehicle objects to put into vector.\n";
cin>> num;
for (int i = 0; i<num; i++)
{
xvector.push_back(unit);
cout <<"Issue Idtag = "<< xvector.size()-1<<" to those objects."<<endl;
}
return 0 ;
}
int factory()
{
cout<<"Create 'p3-van' objects. \n";
P3van p3vanobj; xCreator (p3vanobj);
cout<<"Create 'S-struck' objects. \n";
Struck struckobj; allCreator (struckobj);
cout<<"Create '76 s-truck' objects. \n";
Svan76 svan76obj; allCreator(svan76obj);
return 0;
}
template < class T2 >
int transport (vector<T2> &gen2vector )
{
int yesno = 'y'||'n';
cout<<"Do you wish to transport?\n";
cin>> yesno;
if (yesno=='y')
{
int entry;
cout <<"Enter ID tag.\n";
cin>>entry;
cout<<"Transporter type is "<< gen2vector[entry].id <<endl;
gen2vector[entry].carry = 'y';
cout<<"Is it transporting? "<<gen2vector[entry].carry<<endl;
cout<<"now return to movement function.\n";
}
if (yesno=='n')
{
cout<<"returning to movements function.\n";
}
return 0;
}
template < class T >
void movements (vector<T> &genvector)
{
int entry;
cout <<"Select ID tag.\n";
cin>>entry;
cout<<"Vehicle type in movements is "<< genvector[entry].id<<endl;
transport(genvector);
cout<<"finished with movements function.\n";
}
int main ()
{
factory();
char anykey;
cout <<"Send S-trucks to movements. Press any key.\n";
cin>> anykey;
movements(allvector);
char any;
cout <<"Send P3 x-van to movements. Press any key.\n";
cin>> any;
movements (xvector);
system ("pause");
return 0;
}


Sign In
Create Account


Back to top









