59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
// Implementation file for the Park class
|
|
// Written By: Iurii Tatishchev
|
|
// Reviewed by: Iurii Tatishchev
|
|
// IDE: CLion
|
|
|
|
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <string>
|
|
|
|
#include "Park.h"
|
|
|
|
using namespace std;
|
|
|
|
// **************************************************
|
|
// Constructor
|
|
// **************************************************
|
|
Park::Park() {
|
|
code = "";
|
|
state = "";
|
|
name = "";
|
|
description = "";
|
|
year = -1;
|
|
}
|
|
|
|
// **************************************************
|
|
// Overloaded Constructor
|
|
// **************************************************
|
|
Park::Park(string cd, string st, string nm, string dsc, int yr) {
|
|
code = cd;
|
|
state = st;
|
|
name = nm;
|
|
description = dsc;
|
|
year = yr;
|
|
}
|
|
|
|
// ***********************************************************
|
|
// Displays the values of a Park object member variables
|
|
// on one line (horizontal display)
|
|
// ***********************************************************
|
|
ostream& operator<<(ostream &out, const Park &park) {
|
|
out << park.code << " ";
|
|
out << park.state << " ";
|
|
out << park.year << " ";
|
|
out << park.name << " ";
|
|
return out;
|
|
}
|
|
|
|
// ***********************************************************
|
|
// Displays the values of a Park object member variables
|
|
// one per line (vertical display)
|
|
// ***********************************************************
|
|
void Park::vDisplay() const {
|
|
cout << name << endl;
|
|
cout << " \"" << description << "\"" << endl;
|
|
cout << year << endl;
|
|
cout << state << endl;
|
|
}
|