//-------------------------------------------------------------------- // // Laboratory 7, In-lab Exercise 1 slideshw.cs // // (Shell) Slide show program // //-------------------------------------------------------------------- // Displays a slide show. #include #include #include "listlnk.cpp" using namespace std; //-------------------------------------------------------------------- //This is a very ugly way to wait for a specified amount of time. //However, it is also very portable. This function should work on //all platforms that support ANSI C++. Feel free to replace this //with something nicer if you so choose. void wait(int secs) { int start=clock(); while (clock() < start + secs * CLOCKS_PER_SEC); } const int slideHeight = 10, // Slide dimensions slideWidth = 36; class Slide { public: void read ( ifstream &inFile ); // Read slide from file void display () const; // Display slide and pause private: char image [slideHeight] [slideWidth]; // Slide image int pause; // Seconds to pause after // displaying slide }; //-------------------------------------------------------------------- void main () { List slideShow; // Slide show Slide currSlide; // Slide char filename[81]; // Name of slide show file // Read the slide show from the specified file. cout << endl << "Enter the name of the slide show file : "; cin >> filename; ifstream slideFile ( filename ); if ( !slideFile ) { cout << "Error opening file " << filename << endl; } else { // Read in the slides one-by-one. (Your code below) // Close the file. (Your code below) // Display the slide show slide-by-slide. (Your code below) } } //-------------------------------------------------------------------- void Slide:: read ( ifstream &inFile ) // Read a slide from inFile. (Your code below) { } //-------------------------------------------------------------------- void Slide:: display () const // Display a slide and pause. (Your code below) { }