Advertisement
Guest User

Email Simulator

a guest
Nov 9th, 2020
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 18.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <stdlib.h> //for system("CLS");
  4. #include <windows.h> //for GetAsyncKeyState();
  5.  
  6. using namespace std;
  7.  
  8. struct Email //just a basic struct
  9. {
  10.     //below is just data stored in the node
  11.     string sender;
  12.     string recipient;
  13.  
  14.     string day, month, year;
  15.  
  16.     string title;
  17.     string content;
  18.  
  19.     //adapted from https://docs.microsoft.com/en-us/cpp/code-quality/c26495?view=msvc-160 , where it is set via default member initialization;
  20.     int index{}; //every new email will have a different index, used to traverse and pinpoint the correct email.
  21.  
  22.     Email* prev{}, * next{}; //just previous and next nodes
  23. };
  24.  
  25. Email* myTemplate() //used to initialise a struct (alternative of constructor)
  26. {
  27.     Email* temp = new Email;
  28.  
  29.     temp->sender = "\0";
  30.     temp->recipient = "\0";
  31.  
  32.     temp->day = "\0";
  33.     temp->month = "\0";
  34.     temp->year = "\0";
  35.  
  36.     temp->title = "\0";
  37.     temp->content = "\0";
  38.  
  39.     temp->index = 0;
  40.     temp->next = NULL;
  41.     temp->prev = NULL;
  42.  
  43.     return temp;
  44. };
  45.  
  46. struct UI //another basic struct, but using constructors
  47. {
  48.     UI* prev, * next; //previous and next nodes
  49.     string text[2]; //stores the selected text and unselected text
  50.  
  51.     bool selected; //bool to know when to trigger selected text
  52.     int menuFunc; //used to determine which function to call, can also be used to represent Email's index when passing in values
  53.  
  54.     UI()
  55.     {
  56.         prev = NULL;
  57.         next = NULL;
  58.         text[0] = "\0";
  59.         text[1] = "\0";
  60.  
  61.         selected = false;
  62.        
  63.         menuFunc = -1;
  64.     }
  65.  
  66.     UI(UI* myPrev, UI* myNext, int myMFunc, string myText)
  67.     {
  68.         prev = myPrev;
  69.         next = myNext;
  70.         menuFunc = myMFunc;
  71.         text[0] = myText;
  72.         text[1] = "<<" + text[0] + ">>";
  73.  
  74.         selected = false;
  75.     }
  76. };
  77.  
  78. void mainMenu(UI* uiNavi, UI* uiHead)
  79. {
  80.     uiNavi = uiHead; //sets navigator to first element if it isn't already
  81.     cout << endl <<
  82.         "Welcome to the email simulator! Please select your operation from the list below." << endl <<
  83.         "_________________________________________________________________________________" << endl << endl;
  84.     while (uiNavi != NULL)//loop stops when it finally reaches NULL
  85.     {
  86.         cout << uiNavi->text[(int)uiNavi->selected] << endl << endl; //if the current uiNavi->selected is true, then the selected text will be displayed instead
  87.         uiNavi = uiNavi->next;
  88.     }
  89.     cout <<
  90.         "_________________________________________________________________________________" << endl <<
  91.         "[Use ARROW KEYS UP & DOWN to navigate, ENTER/RETURN to select operation]" << endl;
  92. }
  93.  
  94. int getKeyInt() //just a function to get relevant key codes
  95. {
  96.    
  97.     if (GetAsyncKeyState(VK_UP))
  98.     {
  99.         return VK_UP;
  100.     }
  101.     else if (GetAsyncKeyState(VK_DOWN))
  102.     {
  103.         return VK_DOWN;
  104.     }
  105.     else if (GetAsyncKeyState(VK_RETURN))
  106.     {
  107.         return VK_RETURN;
  108.     }
  109.     else if (GetAsyncKeyState(VK_ESCAPE))
  110.     {
  111.         return VK_ESCAPE;
  112.     }
  113.     else
  114.     {
  115.         return -1;
  116.     }
  117. }
  118.  
  119. void displayEmail(int mailIndex, Email* eNavi, Email* eHead, Email* eTail) //used when displaying the individual stored emails
  120. {
  121.     system("CLS");
  122.     eNavi = eHead; //sets email navigator to earliest element in the stack
  123.     while (eNavi->index != mailIndex) //traverse the linked list until it reaches the email with the same index, reference line XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX for explanation
  124.     {
  125.         eNavi = eNavi->next;
  126.     }
  127.     cout <<
  128.         "\nSender's Name: " << eNavi->sender <<
  129.         "\nRecipient's Name: " << eNavi->recipient <<
  130.         "\n\nDate: " << eNavi->day + " . " + eNavi->month + " . " + eNavi->year <<
  131.         "\n\nTitle: " << eNavi->title <<
  132.         "\n\nContent: \n" << eNavi->content << endl;
  133.     system("pause");
  134.     return;
  135. }
  136.  
  137. void deleteMail(Email*& eNavi, Email*& eHead, Email*& eTail, int mailIndex, bool& modified) //used to remove nodes from the link list, not exactly popping though.
  138. {
  139.     system("CLS");
  140.    
  141.     string temp = "\0"; //just to get user confirmation
  142.  
  143.     cout << "\nAre you sure you want to delete this mail? Once deleted the data is gone forever!\nType DELETE to confirm mail deletion (CASE SENSITIVE), type anything else to cancel.\n:";
  144.     cin >> temp;
  145.  
  146.     if (temp == "DELETE")
  147.     {
  148.         eNavi = eHead; //sets email navigator to earliest element in the node again if it isn't already
  149.         while (eNavi->index != mailIndex) //traversing until the desired email to delete is reached, lets call this node a "node of interest"
  150.         {
  151.             eNavi = eNavi->next;
  152.         }
  153.  
  154.         if (eNavi != NULL)//just in case for some reason the email was a NULL
  155.         {
  156.             if (eNavi->next != NULL)//if the "node of interest" has an earlier node
  157.             {
  158.                 eNavi = eNavi->next;//navigator will switch addresses to earlier node
  159.  
  160.                 if (eNavi->prev->prev != NULL)//if the "node of interest" has a newer node after itself
  161.                 {
  162.                     eNavi->prev = eNavi->prev->prev; //navigator will point it's current "prev" to change from "node of interest" to the node after the "node of interest"
  163.                     eNavi->prev->next = eNavi; //and that node will point it's "next" to the navigator's current address
  164.                 }
  165.                 else//if "node of interest" doesn't have a newer node, ie. it is the latest added node
  166.                 {
  167.                     eNavi->prev = NULL;//navigator will point it's current "prev" to change from "node of interest" to NULL
  168.                     eTail = eNavi; //a tail node will be assigned to navigator's address
  169.                 }              
  170.             }
  171.             else if(eNavi->prev != NULL)//if "node of interest" has a newer node added after itself
  172.             {
  173.                 eNavi = eNavi->prev; //navigator will then siwtch addresses to newer node
  174.                 eNavi->next = NULL; //navigator will point it's "next" to change from "node of interest" to a NULL
  175.                 eHead = eNavi; //a head node will be assigned to navigator's address
  176.             }
  177.             else// if "node of interest" doesn't have an earlier node or a newer node after itself
  178.             {
  179.                 eHead = myTemplate(); //head will be reinitialised
  180.                 eTail = eHead; //tail will have the same address as head
  181.                 eNavi = eHead; //navigator will also have the same address as head
  182.             }
  183.         }      
  184.  
  185.         cout << "Mail was deleted." << endl;
  186.         modified = true; //used in refreshing the displayInbox() function to re-trigger the stuff outside the loop
  187.         system("pause");
  188.        
  189.         return;
  190.     }
  191.     else
  192.     {
  193.         return;
  194.     }
  195. }
  196.  
  197. bool mailExecute(int executionCode, bool runFlag, UI* myNavi, UI* myHead, UI* uiTailIB, Email*& eNavi, Email*& eHead, Email*& eTail, int mailIndex, bool& modified) //a hub to determine what function is to be called based on the selected UI node
  198. {
  199.     if (executionCode == 1)
  200.     {
  201.         if (mailIndex != -1 && mailIndex != 0) // -1 and 0 are both default nodes, so they shouldn't trigger
  202.         {
  203.             displayEmail(mailIndex, eNavi, eHead, eTail);
  204.         }
  205.         else
  206.         {
  207.             system("CLS");
  208.             cout << "\nNo mail to read!" << endl;
  209.             system("pause");
  210.         }
  211.         return runFlag; //used to determine if the main loop outside this function with continue running or not
  212.     }
  213.     else if (executionCode == 2)
  214.     {
  215.         deleteMail(eNavi, eHead, eTail, mailIndex, modified);
  216.         runFlag = false;
  217.         return runFlag;
  218.     }
  219.     else if (executionCode == 99)
  220.     {
  221.         runFlag = false;
  222.         return runFlag;
  223.     }
  224.     else
  225.     {
  226.         cout << "\nINVALID CODE" << endl; //usually not triggered, just in case
  227.         return runFlag;
  228.     }
  229. }
  230.  
  231. bool prompt(string selectedText, int mailIndex, Email*& eNavi, Email*& eHead, Email*& eTail, bool& modified) //a selected mail hub to determine what function is to be called based on the selected UI node, triggered when a mail is selected
  232. {
  233.     bool tempRunFlag = true; // just a temporary run flag to determine if the loop will continue to run
  234.     int tempKeyPress; // to log the current keypress
  235.     UI* myNavi = new UI, * myHead = myNavi, * myTail = myNavi; //creating temporary UI nodes to use with this function
  236.     UI* refreshCache = new UI; // to log the navigator's location upon reprinting the screen
  237.  
  238.     //initialising the UI nodes
  239.     myNavi->next = new UI(NULL, NULL, 1, "READ EMAIL");
  240.     myNavi = myNavi->next;
  241.     myHead = myNavi;
  242.     myHead->selected = true;
  243.     myNavi->next = new UI(myNavi, NULL, 2, "DELETE EMAIL");
  244.     myNavi = myNavi->next;
  245.     myNavi->next = new UI(myNavi, NULL, 99, "BACK");
  246.     myNavi = myNavi->next;
  247.     myTail = myNavi;
  248.     refreshCache = myHead; //before the loop happens, it points to a head node
  249.  
  250.     while (tempRunFlag)
  251.     {
  252.         system("CLS");
  253.         cout << "SELECTED MAIL:\n" + selectedText << endl << endl; //shares the same text to indicate selected mail
  254.         myNavi = myHead; //navigator will switch to head's address
  255.         while (myNavi != NULL)//printing out the UI nodes
  256.         {
  257.             cout << myNavi->text[(int)myNavi->selected] << endl;
  258.             myNavi = myNavi->next;
  259.         }
  260.         cout << "\n[Use ARROW KEYS UP & DOWN to navigate, ENTER / RETURN to select operation]" << endl;
  261.         myNavi = refreshCache;//will be used to point navigator to a different node after printing for selection purposes
  262.         system("pause");
  263.         tempKeyPress = getKeyInt();
  264.  
  265.         //used to navigate the nodes
  266.         switch (tempKeyPress)
  267.         {
  268.         case VK_UP:
  269.             if (myNavi != myHead)
  270.             {
  271.                 myNavi->selected = false;
  272.                 myNavi = myNavi->prev;
  273.                 myNavi->selected = true;
  274.                 refreshCache = myNavi; //saves the address to be reassigned to navigator after the reprinting
  275.             }
  276.             else
  277.             {
  278.                 break;
  279.             }
  280.             break;
  281.         case VK_DOWN:
  282.             if (myNavi != myTail)
  283.             {
  284.                 myNavi->selected = false;
  285.                 myNavi = myNavi->next;
  286.                 myNavi->selected = true;
  287.                 refreshCache = myNavi;
  288.             }
  289.             else
  290.             {
  291.                 break;
  292.             }
  293.             break;
  294.         case VK_RETURN:
  295.             tempRunFlag = mailExecute(myNavi->menuFunc, tempRunFlag, myNavi, myHead, myTail, eNavi, eHead, eTail, mailIndex, modified); //to determine whether the loop should continue or break after function is called
  296.             break;
  297.         default:
  298.             break;
  299.         }
  300.     }
  301.     return !modified; //returns an inverse of the "modified" bool, to determine whether the loop should continue or break
  302. }
  303.  
  304. void displayInbox(UI* myNavi, UI* myHead, UI* myTail, Email*& eNavi, Email*& eHead, Email*& eTail) //displays the inbox of the mail
  305. {
  306.     bool modified = false;
  307.     bool tempRunFlag = true;
  308.     int tempKeyPress;
  309.  
  310.     UI* refreshCache = myHead; // to log the navigator's location upon reprinting the screen, points to head before the loop begins
  311.  
  312.     myNavi = myHead; //points the navigator to the newest node in the list
  313.  
  314.     eNavi = eTail; //email navigator switches address to the newest node in the email linked list
  315.  
  316.     if (eNavi->sender != "\0") //to check if newest mail has values, just in case
  317.     {
  318.         myNavi->menuFunc = eNavi->index; //assigns the email index to the "menuFunc" to be passed when calling deleteMail() and displayMail()
  319.         myNavi->text[0] = eNavi->sender + "|| " + eNavi->title + " || " + (string)eNavi->day + " . " + (string)eNavi->month + " . " + (string)eNavi->year;  //sets the UI text of navigator
  320.         myNavi->text[1] = "<<" + myNavi->text[0] + ">>";
  321.         myHead = myNavi;//setting myHead to point to navigator's current address
  322.         myHead->selected = true; //this will trigger the selected text's output later
  323.         refreshCache = myHead;// assigns refreshCache to myHead
  324.         myTail = myHead; //if it's only 1 mail in the list, then this will prevent UI from traversing into NULL, if not, below will change the values
  325.  
  326.         if (eNavi->prev != NULL)//if email navigator has a earlier mail to point to, false if there's only 1 element in the list, which is already done above
  327.         {
  328.             while (eNavi != NULL)//if email navigator is not pointing to the earliest mail, or if theres only 1 element
  329.             {
  330.                 if (eNavi != eHead) //double checking if email navigator hasn't reached the earliest mail yet, if it is, then no need to go even earlier
  331.                 {
  332.                     eNavi = eNavi->prev; //email navigator approaches eHead by 1 node
  333.                 }
  334.                 myNavi->next = new UI(myNavi, NULL, eNavi->index, eNavi->sender + "|| " + eNavi->title + " || " + eNavi->day + " . " + eNavi->month + " . " + eNavi->year); //creates a new node to point to
  335.                 myNavi = myNavi->next; // navigator switch to the next address that it created
  336.                 myTail = myNavi; //assigns tail to newly created UI navigator node
  337.             }
  338.         }
  339.     }
  340.     else //if newest mail has no values, or no mail
  341.     {
  342.         myHead = new UI(NULL, NULL, 0, "nothing to see here");
  343.         myHead->selected = true;
  344.         refreshCache = myHead;
  345.         myTail = myHead;
  346.     }
  347.  
  348.     while (tempRunFlag)
  349.     {
  350.         system("CLS");
  351.         cout <<
  352.             "\nNow browsing inbox..." << endl <<
  353.             "_____________________________________________________________________________________________________________________" << endl <<
  354.             "SENDER\t\t||\t\t\t\tTITLE\t\t\t\t\t||\tDATE" << endl;
  355.         myNavi = myHead; //UI navigator will be reassigned to point to first UI
  356.         while (myNavi != NULL)
  357.         {
  358.             cout << myNavi->text[(int)myNavi->selected] << endl;
  359.             myNavi = myNavi->next;
  360.         }
  361.         myNavi = refreshCache;//similar implementation in the prompt() function;
  362.         if (myNavi != NULL)
  363.         {
  364.             cout << "\nMenu Function code: " << myNavi->menuFunc << endl;//used for debugging, displays the menuFunc
  365.         }
  366.         cout <<
  367.             "\n\nReached end of inbox" << endl <<
  368.             "_____________________________________________________________________________________________________________________" << endl <<
  369.             "[Use ARROW KEYS UP & DOWN to navigate, ENTER/RETURN to select operation, ESC to return to Main Menu]" << endl;
  370.         system("pause");
  371.  
  372.         tempKeyPress = getKeyInt();
  373.  
  374.         switch (tempKeyPress)
  375.         {
  376.         case VK_UP:
  377.             if (myNavi != myHead)
  378.             {
  379.                 myNavi->selected = false;
  380.                 myNavi = myNavi->prev;
  381.                 myNavi->selected = true;
  382.                 refreshCache = myNavi;
  383.             }
  384.             break;
  385.         case VK_DOWN:
  386.             if (myNavi != myTail)
  387.             {
  388.                 myNavi->selected = false;
  389.                 myNavi = myNavi->next;
  390.                 myNavi->selected = true;
  391.                 refreshCache = myNavi;
  392.             }
  393.             break;
  394.         case VK_RETURN:
  395.             if (eHead->sender != "\0")
  396.             {
  397.                 tempRunFlag = prompt(myNavi->text[(int)myNavi->selected], myNavi->menuFunc, eNavi, eHead, eTail, modified); //to determine whether the loop should continue or break after function is called
  398.             }
  399.             break;
  400.         case VK_ESCAPE:
  401.             tempRunFlag = false;
  402.             break;
  403.         default:
  404.             break;
  405.         }      
  406.     }
  407.     return;
  408. }
  409.  
  410.  
  411. void pushMail(Email * &eHead, Email * &eTail, Email * &draft) //used to actually push the mail into the mail linked list
  412. {
  413.     if (eHead->sender == "\0") //if current head node is empty
  414.     {
  415.         draft->prev = NULL;
  416.         draft->index = eTail->index + 1;
  417.         eHead = draft;
  418.         eTail = eHead;
  419.     }
  420.     else //if head node already has a value
  421.     {
  422.         draft->prev = eTail;
  423.         draft->index = eTail->index + 1;
  424.         eTail->next = draft;
  425.         eTail = draft;
  426.     }
  427. }
  428.  
  429. void composeEmail(Email*& eHead, Email*& eTail) //prompting the user to get data
  430. {
  431.     Email* draft = new Email;
  432.     system("CLS");
  433.     if (eHead->sender != "\0") ///used to get rid of a \n character in the buffer for no reason, I don't know why it's there, but whats weird is that it only happens once the email linked list already has 1 element inside of it
  434.     {
  435.         cin.ignore();
  436.     }
  437.  
  438.     do
  439.     {
  440.         cout << "\nPlease type in the sender's name (16 Character Limit)" << endl;
  441.         getline(cin, draft->sender);
  442.     }
  443.     while (draft->sender.length() > 16 || draft->sender.length() <= 0);
  444.     while (draft->sender.length() < 16)
  445.     {
  446.         draft->sender += " ";
  447.     }
  448.  
  449.     do
  450.     {
  451.         cout << "\nPlease type in the recipient's name (16 Character Limit)" << endl;
  452.         getline(cin, draft->recipient);
  453.     }
  454.     while (draft->recipient.length() > 16 || draft->recipient.length() <= 0);
  455.  
  456.     //I forgot why I separated day, month and year
  457.     do
  458.     {
  459.         cout << "\nPlease type in the date of the month in numbers (Eg. 02 for 2nd day of the month, 10 for 10th)" << endl;
  460.         cin >> draft->day;
  461.     } while (draft->day.length() != 2);
  462.  
  463.     do
  464.     {
  465.         cout << "\nPlease type in the month in numbers (Eg. 03 for MARCH, 12 for DECEMBER)" << endl;
  466.         cin >> draft->month;
  467.     } while (draft->month.length() != 2 );
  468.  
  469.     do
  470.     {
  471.         cout << "\nPlease type in the year (Eg. 2020, 1956, 0126)" << endl;
  472.         cin >> draft->year;
  473.         cin.ignore();
  474.     } while (draft->year.length() != 4);
  475.  
  476.     do
  477.     {
  478.         cout << "\nPlease type in the email title (72 Character Limit)" << endl;
  479.         getline(cin, draft->title);
  480.     }
  481.     while (draft->title.length() > 68 || draft->title.length() <= 0);
  482.     while (draft->title.length() < 68)
  483.     {
  484.         draft->title += " ";
  485.     }
  486.  
  487.     cout << "\nPlease type in your email content below: " << endl;
  488.     cout << "(When done, enter a \\ character to complete the email and send it)" << endl;
  489.     getline(cin, draft->content, '\\'); //changed the delimiter to a "\" character so we can type in paragraphs without worry
  490.  
  491.     cout << "\n\nEmail is sent! Please check inbox." << endl;
  492.  
  493.     draft->next = NULL;
  494.     pushMail(eHead, eTail, draft);
  495.    
  496.     system("pause");
  497. }
  498.  
  499. bool terminateSim(bool runFlag) //used to confirm if user wants to quit the email simulator
  500. {
  501.     system("CLS");
  502.     string temp = "\0";
  503.     cout << "\nAre you sure you want to quit? Any data during this session is NOT stored\n\n Type \"QUIT\" to confirm (CASE SENSITIVE)\n or type anything else to continue session.\n";
  504.     cin >> temp;
  505.    
  506.     if (temp == "QUIT")
  507.     {
  508.         return !runFlag;
  509.     }
  510.     else
  511.     {
  512.         return runFlag;
  513.     }
  514. }
  515.  
  516. bool mainMenuExecute(int executionCode, bool runFlag, UI* uiNaviIB, UI* uiHeadIB, UI* uiTailIB, Email*& eNavi, Email*& eHead, Email*& eTail) //a hub similar to prompt()
  517. {
  518.     if (executionCode == 1)
  519.     {
  520.         composeEmail(eHead, eTail);
  521.         return runFlag;
  522.     }
  523.     else if (executionCode == 2)
  524.     {
  525.         displayInbox(uiNaviIB, uiHeadIB, uiTailIB, eNavi, eHead, eTail);   
  526.         return runFlag;
  527.     }
  528.     else if (executionCode == 99)
  529.     {
  530.         return terminateSim(runFlag);
  531.     }
  532.     else
  533.     {
  534.         cout << "\nINVALID CODE" << endl;
  535.         return runFlag;
  536.     }
  537. }
  538.  
  539. int main()
  540. {
  541.     //Main Menu UI
  542.     UI  * composer = new UI(NULL, NULL, 1, "Compose an email to yourself"),
  543.         * inboxer = new UI(composer, NULL, 2, "Look through your inbox"),
  544.         * terminator = new UI(inboxer, NULL, 99, "Terminate email simulator");
  545.     composer->next = inboxer;
  546.     inboxer->next = terminator;
  547.     UI  * uiHeadMM = composer,
  548.         * uiTailMM = terminator,
  549.         * uiNaviMM = uiHeadMM;
  550.     uiNaviMM->selected = true;
  551.  
  552.    
  553.     //Inbox UI
  554.     UI  * uiHeadIB = new UI(NULL,NULL,0,"nothing to see here"),
  555.         * uiTailIB = uiHeadIB,
  556.         * uiNaviIB = uiHeadIB;
  557.         uiNaviIB->selected = true;
  558.    
  559.  
  560.     //Actual mail stuff
  561.     Email   * mHead = myTemplate(),
  562.             * mTail = mHead;
  563.     Email   * mNavi = mHead;
  564.    
  565.  
  566.     bool simulate = true; ///similar to tempRunFlag
  567.     int keypress;
  568.  
  569.     while (simulate)
  570.     {
  571.         system("CLS");
  572.         mainMenu(uiNaviMM, uiHeadMM);
  573.         system("pause");
  574.         keypress = getKeyInt();
  575.  
  576.         switch (keypress)
  577.         {
  578.         case VK_UP:
  579.             if (uiNaviMM->prev != NULL)
  580.             {
  581.                 uiNaviMM->selected = false;
  582.                 uiNaviMM = uiNaviMM->prev;
  583.                 uiNaviMM->selected = true;
  584.             }
  585.             else //used to rotate selection
  586.             {
  587.                 uiNaviMM->selected = false;
  588.                 uiNaviMM = uiTailMM;
  589.                 uiNaviMM->selected = true;
  590.             }
  591.             break;
  592.         case VK_DOWN:
  593.             if (uiNaviMM->next != NULL)
  594.             {
  595.                 uiNaviMM->selected = false;
  596.                 uiNaviMM = uiNaviMM->next;
  597.                 uiNaviMM->selected = true;
  598.             }
  599.             else
  600.             {
  601.                 uiNaviMM->selected = false;
  602.                 uiNaviMM = uiHeadMM;
  603.                 uiNaviMM->selected = true;
  604.             }
  605.             break;
  606.         case VK_RETURN:
  607.             simulate = mainMenuExecute(uiNaviMM->menuFunc, simulate, uiNaviIB, uiHeadIB, uiTailIB, mNavi, mHead, mTail);
  608.             break;
  609.         default:
  610.             break;
  611.         }
  612.     }
  613.  
  614.     system("CLS");
  615.     cout << "\nThank you for using email simulator, the program will now terminate." << endl;
  616.     system("pause");
  617. }
  618.  
  619.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement