#ifndef _UTILS_H #define _UTILS_H /** * Aquarium Lab Series * Copyright (C) 2000 Alyce Brady * * This header file contains declarations for two utility * functions. The first, which converts an integer to an apstring, is * from Part II of the AP Marine Biology Case Study. The second, * which sorts a vector of fish based on their depth in the aquarium, * is loosely based on a similar function in Part II of the Case * Study. * * Author of SortByDepth: Alyce Brady * * Created: 7/1/99 * * Acknowledgements: * This file 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/ * The IntToString function is the same as that found in Part II of * the Case Study. The SortByDepth function is similar to the sort * function found there. * * 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. * */ #include "apstring.h" #include "apvector.h" #include "AquaFish.h" // Collection of useful utility functions string IntToString(int i); // postcondition: returns stringized form of i void SortByDepth(apvector & list); // precondition: list has no excess capacity // (i.e., list contains list.length() fish to be sorted) // postcondition: list sorted so that entries are // in order top-down/left-right by X and Y Coordinates #endif