cis22c/03-lists/Park.cpp
2024-04-28 11:54:46 -07:00

59 lines
1.4 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)
// ***********************************************************
void Park::hDdisplay() const {
cout << code << " ";
cout << state << " ";
cout << year << " ";
cout << name << " " << endl;
}
// ***********************************************************
// 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;
}