#include #include #include "playpen.h" int main() { try{ int size(0); int xCo(0); // horiz pos int yCo(0); // vert pos int color(0); // get input std::cout << "Please enter a value to represent the pixel x pixel size: " << '\n'; std::cin >> size; if(not std::cin) throw std::exception(); std::cout << "Enter a value for the X (Horizontal) position: " << '\n'; std::cin >> xCo; if(not std::cin) throw std::exception(); std::cout << "Enter a value for the Y (Vertical) position: " << '\n'; std::cin >> yCo; if(not std::cin) throw std::exception(); std::cout << "Finally, please enter a value for the color of the image to plot: \n"; std::cin >> color; if(not std::cin) throw std::exception(); int end(0);// randon != 0 fgw::playpen paper; paper.scale(size); paper.origin(50,50); paper.plot(xCo, yCo, color); do{ paper.display(); std::cout << "Ctrl-C to end program.\n"; std::cin >> end; } while (end != EOF); } catch(...) { std::cerr << "***An exception was thrown.***\n"; } }