Guest User

Untitled

a guest
Aug 25th, 2019
68
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. #include <iostream>
  3. #include "simpio.h"
  4. #include "console.h"
  5. #include "MyQueue.h"
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10. MyQueue queue;
  11. queue.enque(1);
  12. queue.enque(2);
  13. queue.enque(3);
  14. queue.enque(4);
  15. queue.enque(5);
  16. queue.enque(6);
  17. queue.enque(7);
  18. queue.enque(8);
  19. queue.enque(9);
  20. queue.enque(10);
  21. queue.enque(11);
  22.  
  23. cout << "size = " << queue.size() << " must be 11" << endl;
  24.  
  25. cout << "testing peek(), must return 11" << queue.peek() << endl;
  26.  
  27. cout << "begining deque, from 11 to 1" << endl;
  28.  
  29. cout << queue.deque() << endl;
  30. cout << queue.deque() << endl;
  31. cout << queue.deque() << endl;
  32. cout << queue.deque() << endl;
  33. cout << queue.deque() << endl;
  34. cout << queue.deque() << endl;
  35. cout << queue.deque() << endl;
  36. cout << queue.deque() << endl;
  37. cout << queue.deque() << endl;
  38. cout << queue.deque() << endl;
  39. cout << queue.deque() << endl;
  40.  
  41. cout << "end of deque" << endl;
  42.  
  43. cout << "size = " << queue.size() << " must be 0" << endl;
  44.  
  45. cout << "queue must be empty -> " << queue.isEmpty() << endl;
  46.  
  47. cout << "now it should throw error" << endl;
  48.  
  49. cout << queue.deque();
  50.  
  51. return 0;
  52. }
RAW Paste Data