// Copyright 1999 // 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. /////////////////////////////////////////////////////////////////////////////// // Assignment 1 // // Shell for Problems 11, 22, and 24 // /////////////////////////////////////////////////////////////////////////////// // 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" #include "Graphics.h" #include "Random.h" // 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 Exercise11(); void Exercise22(); void Exercise24(); // function definitions void Exercise11(){ // put the code for Exercise 11 here cout << 11 << endl; }; void Exercise22(){ // put the code for Exercise 22 here cout << 22 << endl; }; void Exercise24(){ // put the code for Exercise 24 here cout << 24 << endl; }; 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(); ////////// // Enter the main program here cout << "Recitation 1: Exercises 11, 22, and 24" << endl; int i = 11; while (Confirm("Another Exercise?", true)){ int n = RequestInt("Select exercise (11, 22, or 24): "); switch (n){ case 11: { Exercise11(); break; }; case 22: { Exercise22(); break; }; case 24: { Exercise24(); break; }; default: { cout << "There is no such exercise." << 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; }