#ifndef _AQUARIUM_H #define _AQUARIUM_H /** * Aquarium Lab Series * Copyright (C) 2000 Alyce Brady * * An Aquarium object consists of locations where fish may be. * Multiple fish may have the same location in a aquarium, * so we may assume that each location is larger than a single * fish. * * Author: Alyce Brady * * Created: 7/1/99 * * Acknowledgements: * This class is part of the Aquarium Lab Series, which was inspired * by the AP Marine Biology Case Study found at * http://www.collegeboard.org/ap/computer-science/marine_biology/ * * License: * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ class Aquarium { public: // constructors Aquarium(); // postcondition: width and height are initialized to 0 // (there are no valid locations in such an aquarium) Aquarium(int width, int height); // postcondition: Width() == width, Height() == height // observer functions int Width() const; // returns width of aquarium int Height() const; // returns height of aquarium bool ValidLoc(int x_coord, int y_coord) const; // returns true if and only x_coord and y_coord represent a // valid location inside the aquarium int LeftWallLoc() const; // returns the x coordinate of the aquarium's left wall int RightWallLoc() const; // returns the x coordinate of the aquarium's right wall private: // data members int myWidth; // width of this Aquarium int myHeight; // height of this Aquarium }; #endif