// Copyright 1996 - Mac // Copyright 1999 - PC // College of Computer Science // Northeastern University Boston MA 02115 // This software may be used for educational purposes as long as this copyright // notice is retained at the top of all files // Should this software be modified, the words "Modified from Original" must be // included as a comment below this notice // All publication rights are retained. This software or its documentation may // not be published in any media either in whole or in part. /////////////////////////////////////////////////////////////////////////////// // Wallpaper.cpp // // Individual Lab to practice writing and using functions and nested loops /////////////////////////////////////////////////////////////////////////////// // The standard include files that include traditional C and C++ headers and // many other Core Tools headers ... see CHeaders.h for additional details #include "IOTools.h" // robust input and formatted output #include "Graphics.h" // windows, graphics, color, text, & tools #include "Random.h" // random numbers #include "Delay.h" // delays #include "Hex.h" // hex output for pointers #include "VectorMatrix.h" // double precision arrays #include "FileTool.h" // file input-output and file dialog boxes // Enter project specific include files here as well as classes and functions // that you choose to define in the main shell rather than in separate files // Function prototypes void MyPicture(int x, int y, int width, int height); void Wallpaper(int NumAcross, int NumDown); int main(int argc, char* argv[]) { // Use the following line if you choose NOT to open any graphics windows // InitializeConsole(); // Build graphics window 0 GraphicsWindow GW0(300, 300); // Move the console below graphics window 0 ConsolePlaceBelow(0); // Give the console the focus for user interaction MakeConsoleForeground(); ////////// try { // Enter the main action here within the try clause PressReturn("For 2 by 2 walpaper"); ClearDrawing(); Wallpaper(2, 2); PressReturn("For 4 by 4 walpaper"); ClearDrawing(); Wallpaper(4, 4); PressReturn("For 6 by 4 walpaper"); ClearDrawing(); Wallpaper(6, 4); PressReturn("For 12 by 12 walpaper"); ClearDrawing(); Wallpaper(12, 12); PressReturn("For an upside-down backwards picture"); ClearDrawing(); MyPicture(300, 300, -300, -300); } catch (string& error_message) { cout << "error: " << error_message << endl << endl; } catch (...) { cout << "error: unknown exception" << endl << endl; } ////////// // The lines below make sure that the graphics windows remain open just // before the program terminates PressReturn("\nThe main program is about to terminate\n"); return 0; } // Your function definitions go here. void MyPicture(int x, int y, int width, int height){ /////////////////////////////////////////////////////////////////////////////// // ENTER CODE HERE } void Wallpaper(int NumAcross, int NumDown){ /////////////////////////////////////////////////////////////////////////////// // ENTER CODE HERE }