// File: stock.cpp // Date: 18 Feb 2005 // Author: Goldwasser // // This file serves as a stencil for the 'stock' programming // assignment, which makes use of the EzWindows graphics package. // // It can be compiled with the associated Makefile by typing 'make' // which results in an executable named 'stock' #include #include // the following includes a variety of shapes for your use #include "circle.h" #include "ellipse.h" #include "label.h" #include "ray.h" #include "rect.h" #include "square.h" #include "triangle.h" // Utility functions declared later in this file: void delay(int=-1); string convert(double value); // your code should be placed within this routine. int ApiMain() { // This next line forces the user to enter return before the program // ends. (without this, your drawing would disappear immediately // upon reaching the end of the program) delay(); } // This is the implementation of our convert utility. // YOU DO NOT NEED TO BOTHER READING IT string convert(double value) { stringstream strm; strm << value; return strm.str(); } // This is the implementation of our delay utility. // YOU DO NOT NEED TO BOTHER READING IT void delay(int waittime) { if (waittime>=0) sleep(waittime); else { cout << "press return to continue" << endl; cout << "(or Cntr-C to force exit)" << endl; char buffer[201]; cin.getline(buffer,200); while (cin.eof()); // force infinite loop, for lack of better solution at this time } }