CS270_Assignment 3_082267

CS270_Assignment 3_082267 - /* / Generic map / Gene Lloyd /...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
//************************************ // Generic map // Gene Lloyd // Student 082267 / #include <fstream> // Needed for file I/O. #include <iomanip> // Needed for format manipulation. #include <iostream> #include <map> // Needed for STL classes map and multimap. #include <sstream> #include <stdio.h> #include <stdlib.h> // Needed for converter functions. #include <string> using std::istringstream; // Needed for STL classes map and multimap. using std::ifstream; using std::string; using std::cout; using std::cin; using std::cerr; using std::map; using std::multimap; u using namespace std; //************************************ //In general, C++ strings are preferred over C strings. //************************************ int UserLoop(); //user prompted loop. void UserPause(); //prompts the user to continue. int UserMenu(); //menu to the console. void UserSwitch(int choice); //switch. void CreateExampleTxtFile(); //creates a file named example.txt. void PrintExampleTxtFile(); //reads and prints a file named example.txt. void SizeExampleTxtFile(); //computes and prints the size of the example.txt file. int SearchExampleTxtFile(); //searches example.txt file for a user inputted string. //************************************ //MAIN int main(int argc, char* argv[]) { UserLoop(); return 0; } //************************************ int UserLoop() { int choice = 0; //Instantiates choice as an object of class type int, initializing it's value to 0. bool exitt = false; //Instantiates exitt as an object of class type bool, initializing it's value to false. b do { UserMenu(); cout << endl << endl << endl; cout << " Type the number 1 and press return to run this program again."
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
<< endl << endl << endl; cout << " Type any key and press return to exit ==> "; cin >> choice; if (choice == 1) exitt = false; else exitt = true; }while(exitt == false); UserPause(); return 0; } //************************************ void UserPause() { cout << endl << endl << endl; cout << " "; system("PAUSE"); } //************************************ int UserMenu() { int choice = 0; //Instantiates choice as an object of class type int,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/19/2011 for the course CS 270 taught by Professor None during the Spring '10 term at Grantham.

Page1 / 6

CS270_Assignment 3_082267 - /* / Generic map / Gene Lloyd /...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online