Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need someone to do lab F1 for me, I have attached E4 to this. #include #includ

ID: 666263 • Letter: I

Question

I need someone to do lab F1 for me, I have attached E4 to this.

#include

#include

#include

#include

using namespace std;

enum Kind {business, maintenance, other, box, tank, flat, otherFreight, chair, sleeper, otherPassenger};

string KIND_ARRAY[]={"business", "maintenance", "other", "box", "tank", "flat", "otherFreight", "chair", "sleeper",

"otherPassenger"};

class Car

{

public:

string reportingMark;

int carNumber;

Kind kind;

bool loaded;

string destination;

public:

// #1 DEFAULT constructor

Car()

{

setUp("", 0, other,false, "NONE");

}

// #2 COPY constructor

Car(const Car &obj)

{

setUp(obj.reportingMark, obj.carNumber ,obj.kind, obj.loaded,obj.destination);

}

// #3 accept five constant referance parameters constructor

Car(string reportMark, int cNumber, Kind knd, bool load, string destition)

{

setUp(reportMark, cNumber, knd, load, destition);

}

// #4 DESTRUCTOR

virtual ~Car()

{

}

// Setup

virtual void setUp(string reportMark, int cNumber, Kind knd, bool load, string destition);

// output member function

void output();

// setKind

virtual void setKind(const Kind k)

{

if (k != business && k != maintenance)

kind = other;

}

//Operator Overloading

Car & operator = (const Car & carB);

//operator function

friend bool operator ==(Car A, Car b);

};

/**************************************

* FreightCar Class *

**************************************/

class FreightCar : public Car

{

public:

FreightCar():Car()

{

}

FreightCar(const FreightCar & old) : Car(old)

{

}

FreightCar(string a, int b, Kind c, bool d, string e):Car(a, b, c, d, e)

{

}

//This could be made Virtual but it doesn't have to since its a derived class.

virtual void setKind(const Kind k)

{

if (k != box && k != tank && k != flat)

kind = otherFreight

}

};

/*****************************************

* PassengerCar Class *

*****************************************/

class PassengerCar : public Car

{

public:

PassengerCar():Car()

{

}

PassengerCar(const PassengerCar &old) : Car(old)

{

}

PassengerCar(string a, int b, Kind c, bool d, string e) : Car(a, b, c, d, e)

{

}

//This could be made Virtual but it doesn't have to since its a derived class.

virtual void setKind(const Kind k)

{

if (k != chair && k != sleeper)

kind = otherPassenger;

}

};

/*****************************************

* StringOfCars Class *

*****************************************/

class StringOfCars

{

Car **ptr;

static const int ARRAY_MAX_SIZE = 10;

int size;

public:

// DEFAULT constructor

StringOfCars()

{

ptr = new Car*[ARRAY_MAX_SIZE];

size = 0;

}

//COPY constructor

StringOfCars(const StringOfCars &old)

{

ptr = new Car*[ARRAY_MAX_SIZE];

for (int i = 0; i < ARRAY_MAX_SIZE; i++)

{

Car *p = new Car;

p->reportingMark = old.ptr[i]->reportingMark;

p->carNumber = old.ptr[i]->carNumber;

p->kind = old.ptr[i]->kind;

p->loaded = old.ptr[i]->loaded;

p->destination = old.ptr[i]->destination;

ptr[i]=p;

}

size = old.size;

}

//DESTRUCTOR

virtual ~StringOfCars()

{

delete [] ptr;

}

//Push Function

void push(Car & add);

//Pop Function

void pop(Car & a);

//Output Function

void output();

};

void input(StringOfCars &a);

/********************************

* main function *

********************************/

int main()

{

StringOfCars StringOfcar1;

input(StringOfcar1);

StringOfCars StringOfcar2 = StringOfcar1;

StringOfcar2.output();

return 0;

}

void buildCar(string reportMark, int cNumber, Kind knd, bool load, string destition, StringOfCars & a)

{

Car Cartest(reportMark, cNumber, knd, load, destition);

Cartest.setKind(knd);

a.push(Cartest);

}

void buildPassengerCar(string reportMark, int cNumber, Kind knd, bool load, string destition, StringOfCars & a)

{

PassengerCar Cartest(reportMark, cNumber, knd, load, destition);

Cartest.setKind(knd);

a.push(Cartest);

}

void buildFreightCar(string reportMark, int cNumber, Kind knd, bool load, string destition, StringOfCars & a)

{

FreightCar Cartest(reportMark, cNumber, knd, load, destition);

Cartest.setKind(knd);

a.push(Cartest);

}

void Car::output()

{

cout << left;

cout << setw(20) << "reportingMark" << " " << reportingMark << endl;

cout << setw(20) << "carNumber" << " " << carNumber << endl;

cout << setw(20) << "kind" << " " << KIND_ARRAY[kind] << endl;

if (loaded)

cout << setw(20) << "loaded" << " " << "true" << endl;

else

cout << setw(20) << "loaded" << " " << "false" << endl;

cout << setw(20) << "destination" << " " << destination << endl;

cout << endl;

}

void Car::setUp(string reportMark, int cNumber, Kind knd, bool load, string destition)

{

reportingMark=reportMark;

carNumber=cNumber;

kind =knd;

loaded=load;

destination=destition;

}

/********************************

* operator function *

********************************/

bool operator == (Car A, Car B)

{

if (A.reportingMark == B.reportingMark && A.carNumber == B.carNumber)

return true;

else

return false;

}

/***********************************

* Operator Overloading *

***********************************/

Car & Car::operator=(const Car & carB)

{

setUp(carB.reportingMark, carB.carNumber, carB.kind, carB.loaded, carB.destination);

return * this;

}

/********************************************

* Output function for StringOfCar *

********************************************/

void StringOfCars::output()

{

cout << "car number is:" << size << endl;

for (int i = 0; i < size; i++)

{

ptr[i]->output();

cout << endl;

}

}

/****************************

* push function *

****************************/

void StringOfCars::push(Car &add)

{

Car *pointer = new Car;

*pointer = add;

ptr[size] = pointer;

size++;

}

/***************************

* pop function *

***************************/

void StringOfCars::pop(Car &a)

{

a = *ptr[size-1];

delete ptr[size-1];

size--;

}

/********************************

* input function *

********************************/

void input(StringOfCars & a)

{

ifstream inputFile;

inputFile.open("data.txt");

if (!inputFile)

{

cout << "File open failure";

}

else

{

string type;

string reportingMark;

string order;

int carNumber;

Kind kind = otherPassenger;

string kindinput;

bool loaded = false;

string loadedinput;

string destination;

while (inputFile.peek() != EOF)

{

inputFile >> type;

inputFile >> order;

inputFile >> reportingMark;

inputFile >> carNumber;

inputFile >> kindinput;

kind = otherFreight;

for (int i = 0; i < 9; i ++)

{

if (kindinput == KIND_ARRAY[i])

{

kind = static_cast(i);

break;

}

}

inputFile >> loadedinput;

if (loadedinput == "true")

loaded = true;

else if (loadedinput == "false")

loaded = false;

else

cout << "wrong loaded input"<

while (inputFile.peek() == ' ')

inputFile.get();

getline(inputFile, destination);

if (type == "Car")

buildCar(reportingMark,carNumber,kind,loaded,destination, a);

else if (type == "FreightCar")

buildFreightCar(reportingMark, carNumber, kind, loaded, destination, a);

else if (type == "PassengerCar")

buildPassengerCar(reportingMark, carNumber, kind, loaded, destination, a);

}

}

inputFile.close();

}

Assignment F

Use the style guide, including Additonal styles beginning with

Assignment D.

Problem F1

Copy the solution from problem E4.

Again we will change the implementation of the StringOfCars class, but

keep the public interface. This implementation will use a linked list,

rather than an array or vector to keep the cars in.

So keep all the public function prototypes in the StringOfCars.

Discard all the private data and the implementation of the functions; we

will rebuild all of these.

Do not change anything outside the StringOfCars class.

Build a new class called Node:

We will build our link list using Node objects, linked together to make

a list.

In the private data of the Node class put two pointers:

One with type Node * and name next, which will point to the next node in

the linked list.

The other with type Car* and name data, which will point to the Car data

associated with this node.

Also in the private area create a default constructor that sets the next

and data pointers to zero. Because the constructor is private, only

friends can use this class.

In the public area of the Node class, make StringOfCars a friend class.

The order of the following three things is important:

1. Declare the StringOfCars class with: class StringOfCars;

2. The Node class

3. The StringOfCars class

This is needed because the Node class uses the StringOfCars and the

StringOfCars class uses the Node class.

In the StringOfCars class implementation:

Replace the private data with two pointers of type Node *, and nothing

else. Name these two pointers head and tail.

Change the StringOfCars default constructor to set the head and tail

pointers to zero.

Rebuild the push function, with the same function heading.

Declare a local pointer variable of type Car * named currentCarPtr.

Declare a local pointer variable of type Node * named currentNodePtr.

Use new to get space in the heap for a Node and save the address of the

space in the heap in currentNodePtr

Use new get space in the heap for a new car that is a copy of the car

prameter of the push function as you did in problem E4 and save the

address of the space in the heap in currentCarPtr

Set the data pointer in this new Node object to point to the new car

object.

If the head pointer is zero

set the head and the tail pointer to the value of currentNodePtr

else

set the next pointer of the Node object pointed to by the tail pointer

to the value of currentNodePtr

set the last pointer to the value of the currentNodePtr

Do not write a pop function.

Rebuild the output function, with the same function heading.

Declare a local pointer variable of type Node * named currentNodePtr -

it will point to the Node we are currently working on.

if the head pointer is zero

print: NO cars

else

set the currentNodePointer to the value of the head pointer

while the currentNodePointer is not zero

print the Car pointed to by the currentNodePointer

set the currentNodePtr to the next pointer in the Node pointed to

by currentNodePtr, which now makes the next Node the current Node

Rebuild the copy construtor.

Declare a local pointer variable of type Node * named currentNodePtr -

it will point to the Node in the oldStringOfCars that we are currently

working on.

Set the head and tail pointers in the StringOfCars being constructed to

zero.

If the oldStringOfCars head pointer is not zero:

loop while the currentNodePointer is not zero,

push the Car pointed to by the data pointer in the current Node,

which is pointed to by the currentNodePointer.

set the currentNodePtr to the next pointer in the currentNodePtr

so we now make the next Node the current Node

Use the same tests as in problem E4.

Explanation / Answer

#include &lt;new&gt;
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
#include &lt;cmath&gt;
#include &lt;algorithm&gt;
#include &lt;fstream&gt;
#include &lt;cstdlib&gt;
using namespace std;
enum Kind {business, maintenance, other, box, tank, flat, otherFreight, chair,
sleeper, otherPassenger};
string KIND_ARRAY={&quot;business&quot;, &quot;maintenance&quot;, &quot;other&quot;, &quot;box&quot;, &quot;tank&quot;, &quot;flat&quot;,
&quot;otherFreight&quot;, &quot;chair&quot;, &quot;sleeper&quot;, &quot;otherPassenger&quot;};

class Car
{
protected:
string reportingMark;
int carNumber;
Kind kind;;
bool loaded;
string destination;
public:

Car(const Car &amp; t )

{

*this = t;
}
Car( string r,int c,string K, bool l,string d);

Car ();
virtual ~Car();

void setUp( string reportingMark, int carNumber, string Kind, bool loaded,
string destination);
void output();
virtual void setKind(string const_string);

friend bool operator==(Car carA, Car carB);
Car &amp;operator = (const Car &amp;);
};

class FreightCar:public Car
{
public:
FreightCar()
{
reportingMark = &quot;&quot;;
carNumber
= 0;
kind
= other;
loaded
= false;
destination

= &quot;NONE&quot;;
}
FreightCar(const FreightCar &amp;obj)
{
reportingMark = obj.reportingMark;
carNumber
= obj.carNumber;
kind
= obj.kind;
loaded
= obj.loaded;
destination
= obj.destination;
}
FreightCar(string report_mark, int car_num, string kind_car, bool
loaded_of_car, string d_place)
{
setUp(report_mark,car_num,kind_car,loaded_of_car,d_place)
}

void setKind(string const_string);
};
void FreightCar::setKind(string const_string)
{
if (const_string == &quot;box&quot;)

= &quot;NONE&quot;;
}
FreightCar(const FreightCar &amp;obj)
{
reportingMark = obj.reportingMark;
carNumber
= obj.carNumber;
kind
= obj.kind;
loaded
= obj.loaded;
destination
= obj.destination;
}
FreightCar(string report_mark, int car_num, string kind_car, bool
loaded_of_car, string d_place)
{
setUp(report_mark,car_num,kind_car,loaded_of_car,d_place)
}

void setKind(string const_string);
};
void FreightCar::setKind(string const_string)
{
if (const_string == &quot;box&quot;)

reportingMark = obj.reportingMark;
carNumber
= obj.carNumber;
kind
= obj.kind;
loaded
= obj.loaded;
destination
= obj.destination;
}
PassengerCar(string report_mark, int car_num, string kind_car, bool
loaded_of_car, string d_place)
{
setUp(report_mark,car_num,kind_car,loaded_of_car,d_place);
}

};

void setKind(string const_string);

void PassengerCar::setKind(string const_string)
{
if (const_string == &quot;chair&quot;)
kind = chair;
else if (const_string == &quot;sleeper&quot;)
kind = sleeper;
else
kind = otherPassenger;
}

class Node
{
private:
Node* next;
Car* data;
Node ()
{
next = 0;
data = 0;
}
public:
friend class StringOfCar;
};

class StringOfCar
{
private:
Node* head;
Node* tail;
public:
StringOfCar()
{
head = 0;
tail = 0;
}
StringOfCar(const StringOfCar &amp;oldStringOfCar)
{
Node *currentNodePtr;
head = 0;
tail = 0;
head = oldStringOfCar.head;
tail = oldStringOfCar.tail;
currentNodePtr = oldStringOfCar.head;
if (oldStringOfCar.head != 0)
{
while (currentNodePtr != 0)
{
push(*(currentNodePtr-&gt;data));
currentNodePtr-&gt;next = 0;
currentNodePtr = (currentNodePtr-&gt;next);
}
}

}
~StringOfCar()
{
}
void push(Car &amp;new_car);
void output();
};
void StringOfCar::output()
{
Node * currentNodePtr;
if (head == 0)
cout &lt;&lt; &quot;NO cars &quot;;
else
{
currentNodePtr = head;

}
}

while (currentNodePtr != 0)
{
currentNodePtr-&gt;data-&gt;output();
currentNodePtr = (currentNodePtr-&gt;next);
}

void StringOfCar::push(Car &amp;new_car)
{
Car *currentCarPtr;
Node *currentNodePtr;
currentNodePtr = new
currentCarPtr = new
currentNodePtr-&gt;next
void push(Car &amp;new_car);
void output();
};
void StringOfCar::output()
{
Node * currentNodePtr;
if (head == 0)
cout &lt;&lt; &quot;NO cars &quot;;
else
{
currentNodePtr = head;

}
}

while (currentNodePtr != 0)
{
currentNodePtr-&gt;data-&gt;output();
currentNodePtr = (currentNodePtr-&gt;next);
}

void StringOfCar::push(Car &amp;new_car)
{
Car *currentCarPtr;
Node *currentNodePtr;
currentNodePtr = new
currentCarPtr = new
currentNodePtr-&gt;next

currentNodePtr-&gt;data

Node;
Car(new_car);
= 0;
= &amp;new_car;

if (head == 0)
{
head = currentNodePtr;
tail = currentNodePtr;
}
else
{
tail-&gt;next = currentNodePtr;
tail
= currentNodePtr;
}
}
void input(StringOfCar&amp;);
int main()
{
StringOfCar car1;
input(car1);
car1.output();
}

void input(StringOfCar&amp;string1)
{
string rep;
string type;
string dest;
string loadString;
int carNum;
bool load;
ifstream inputFile;
inputFile.open(&quot;input2.txt&quot;);
if (inputFile.fail())
{
cerr&lt;&lt; &quot;Error, File not found &quot;;
exit(EXIT_FAILURE);
}

string carType;
while (inputFile.peek()!=EOF)
{
while (inputFile.peek() == ' ')
{
inputFile.get();
}
inputFile&gt;&gt;carType;
inputFile&gt;&gt;rep;
inputFile&gt;&gt;carNum;
inputFile&gt;&gt;type;
inputFile&gt;&gt;loadString;
getline(inputFile, dest);
Car temp (rep, carNum, type, load, dest);
//temp.output();
Car*carptr = &amp;temp;
string1.push(*carptr);
/*if (carType == &quot;Car&quot;)
{Car car1;
car1.setKind(type);
string1.push(car1);
}*/
if (type == &quot;FreightCar&quot;)
{
FreightCar car2;
car2.setKind(type);
string1.push(car2);
}
if (type == &quot;PassengerCar&quot;)
{
PassengerCar car3;
car3.setKind(type);
string1.push(car3);
}
}
inputFile.close();
}

Car &amp; Car::operator=(const Car &amp; carB)
{
reportingMark = carB.reportingMark;
carNumber
= carB.carNumber;
kind
= carB.kind;
loaded
= carB.loaded;
destination
= carB.destination;
return * this;
}

/*

setUp

put data in object

*/

void Car::setUp( string r, int c, string KIND, bool l, string d)
{
reportingMark = r;
carNumber =c;
setKind(KIND);
loaded = l;
destination = d;


F1.cpp


/*/*
Joseph Huang
CIS 22B
Spring 2015
Assignment F
Problem F1
Description of problem:
Introduction to classes (continued)
Overloading function names
Abstract data types
Friend functions
Overloading operators
*/

#include &lt;new&gt;
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
#include &lt;cmath&gt;
#include &lt;algorithm&gt;
#include &lt;fstream&gt;
#include &lt;cstdlib&gt;
using namespace std;
enum Kind {business, maintenance, other, box, tank, flat, otherFreight, chair,
sleeper, otherPassenger};
string KIND_ARRAY={&quot;business&quot;, &quot;maintenance&quot;, &quot;other&quot;, &quot;box&quot;, &quot;tank&quot;, &quot;flat&quot;,
&quot;otherFreight&quot;, &quot;chair&quot;, &quot;sleeper&quot;, &quot;otherPassenger&quot;};

class Car
{
protected:
string reportingMark;
int carNumber;
Kind kind;;
bool loaded;
string destination;
public:

Car(const Car &amp; t )

{

*this = t;
}
Car( string r,int c,string K, bool l,string d);

Car ();
virtual ~Car();

void setUp( string reportingMark, int carNumber, string Kind, bool loaded,
string destination);
void output();
virtual void setKind(string const_string);

friend bool operator==(Car carA, Car carB);
Car &amp;operator = (const Car &amp;);
};

class FreightCar:public Car
{
public:
FreightCar()
{
reportingMark = &quot;&quot;;
carNumber
= 0;
kind
= other;
loaded
= false;
destination
= &quot;NONE&quot;;
}
FreightCar(const FreightCar &amp;obj)
{
reportingMark = obj.reportingMark;
carNumber
= obj.carNumber;
kind
= obj.kind;
loaded
= obj.loaded;
destination
= obj.destination;
}
FreightCar(string report_mark, int car_num, string kind_car, bool
loaded_of_car, string d_place)
{
setUp(report_mark,car_num,kind_car,loaded_of_car,d_place)
}

void setKind(string const_string);
};
void FreightCar::setKind(string const_string)
{
if (const_string == &quot;box&quot;)
kind = box;
else if (const_string == &quot;tank&quot;)
kind = tank;
else if (const_string == &quot;flat&quot;)
kind = flat;
else
kind = otherFreight;
}

;

class PassengerCar:public Car
{
public:
PassengerCar()
{
reportingMark = &quot;&quot;;
carNumber
= 0;
kind
= other;
loaded
= false;
destination
= &quot;NONE&quot;;
}
PassengerCar(const PassengerCar &amp;obj)
{
reportingMark = obj.reportingMark;
carNumber
= obj.carNumber;
kind
= obj.kind;
loaded
= obj.loaded;
destination
= obj.destination;
}
PassengerCar(string report_mark, int car_num, string kind_car, bool
loaded_of_car, string d_place)
{
setUp(report_mark,car_num,kind_car,loaded_of_car,d_place);
}

};

void setKind(string const_string);

void PassengerCar::setKind(string const_string)
{
if (const_string == &quot;chair&quot;)
kind = chair;
else if (const_string == &quot;sleeper&quot;)
kind = sleeper;
else
kind = otherPassenger;
}

class Node
{
private:
Node* next;
Car* data;
Node ()
{
next = 0;
data = 0;
}
public:
friend class StringOfCar;
};

class StringOfCar
{
private:
Node* head;
Node* tail;
public:
StringOfCar()
{
head = 0;
tail = 0;
}
StringOfCar(const StringOfCar &amp;oldStringOfCar)
{
Node *currentNodePtr;
head = 0;
tail = 0;
head = oldStringOfCar.head;
tail = oldStringOfCar.tail;
currentNodePtr = oldStringOfCar.head;
if (oldStringOfCar.head != 0)
{
while (currentNodePtr != 0)
{
push(*(currentNodePtr-&gt;data));
currentNodePtr-&gt;next = 0;
currentNodePtr = (currentNodePtr-&gt;next);
}
}

}
~StringOfCar()
{
}
void push(Car &amp;new_car);
void output();
};
void StringOfCar::output()
{
Node * currentNodePtr;
if (head == 0)
cout &lt;&lt; &quot;NO cars &quot;;
else
{
currentNodePtr = head;

}
}

while (currentNodePtr != 0)
{
currentNodePtr-&gt;data-&gt;output();
currentNodePtr = (currentNodePtr-&gt;next);
}

void StringOfCar::push(Car &amp;new_car)
{
Car *currentCarPtr;
Node *currentNodePtr;
currentNodePtr = new
currentCarPtr = new
currentNodePtr-&gt;next
currentNodePtr-&gt;data

Node;
Car(new_car);
= 0;
= &amp;new_car;

if (head == 0)
{
head = currentNodePtr;
tail = currentNodePtr;
}
else
{
tail-&gt;next = currentNodePtr;
tail
= currentNodePtr;
}
}
void input(StringOfCar&amp;);
int main()
{
StringOfCar car1;
input(car1);
car1.output();
}
/*

input

get the data from the user
*/
void input(StringOfCar&amp;string1)
{
string rep;
string type;
string dest;
string loadString;
int carNum;
bool load;
ifstream inputFile;
inputFile.open(&quot;input2.txt&quot;);
if (inputFile.fail())
{
cerr&lt;&lt; &quot;Error, File not found &quot;;
exit(EXIT_FAILURE);
}

string carType;
while (inputFile.peek()!=EOF)
{
while (inputFile.peek() == ' ')
{
inputFile.get();
}
inputFile&gt;&gt;carType;
inputFile&gt;&gt;rep;
inputFile&gt;&gt;carNum;
inputFile&gt;&gt;type;
inputFile&gt;&gt;loadString;
getline(inputFile, dest);
Car temp (rep, carNum, type, load, dest);
//temp.output();
Car*carptr = &amp;temp;
string1.push(*carptr);
/*if (carType == &quot;Car&quot;)
{Car car1;
car1.setKind(type);
string1.push(car1);
}*/
if (type == &quot;FreightCar&quot;)
{
FreightCar car2;
car2.setKind(type);
string1.push(car2);
}
if (type == &quot;PassengerCar&quot;)
{
PassengerCar car3;
car3.setKind(type);
string1.push(car3);
}
}
inputFile.close();
}

Car &amp; Car::operator=(const Car &amp; carB)
{
reportingMark = carB.reportingMark;
carNumber
= carB.carNumber;
kind
= carB.kind;
loaded
= carB.loaded;
destination
= carB.destination;
return * this;
}

/*

setUp

put data in object

*/

void Car::setUp( string r, int c, string KIND, bool l, string d)
{
reportingMark = r;
carNumber =c;
setKind(KIND);
loaded = l;
destination = d;

}
/*

output

print the data to the screen
*/
void Car::output()
{

cout&lt;&lt;&quot; reportingMark &quot;&lt;&lt;setw(3)&lt;&lt;reportingMark;
cout&lt;&lt;&quot; carNumber &quot;&lt;&lt; setw(8)&lt;&lt; carNumber;
cout&lt;&lt;&quot; kind &quot; &lt;&lt; setw(13)&lt;&lt;KIND_ARRAY[kind];
if (loaded==true)
{
cout&lt;&lt;&quot; loaded
true&quot;;
}
else if (loaded == false)
{
cout&lt;&lt; &quot; loaded
false&quot;;
}
cout&lt;&lt; &quot; destination &quot;&lt;&lt;setw(7)&lt;&lt;destination&lt;&lt;endl;
}

Car ::Car()
{

}

reportingMark = &quot; &quot;;
carNumber =0;
kind = other;
loaded = false;
destination = &quot;NONE&quot;;

Car::Car( string r,
{

setUp(r,c,K,l,d);

int c, string K, bool l,

string d)

}
/*Car::Car(const Car &amp; x )
{
setUp(reportingMark,carNumber,Kind,loaded,destination);
}
*/
Car ::~Car()
{
}
/*

operator friend function

tests to see if two objects are equivalent. The two objects are equivalent if
they have the same reportingMark and number (do not look at the kind, loaded,
and destination fields).
*/
void Car::setKind(string const_string)
{
if (const_string == &quot;business&quot;)
kind = business;
else if (const_string == &quot;maintenance&quot;)
kind = maintenance;
else

if (const_string == &quot;chair&quot;)
kind = chair;
else if (const_string == &quot;sleeper&quot;)
kind = sleeper;
else if (const_string == &quot;box&quot;)
kind = box;
else if (const_string == &quot;tank&quot;)
kind = tank;
else if (const_string == &quot;flat&quot;)
kind = flat;
else

kind = other;

}
bool operator==(Car carA, Car carB)
{
if(carA.reportingMark==carB.reportingMark&amp;&amp;carA.carNumber==carB.carNumber)
return true;
else
return false;
}
/*