Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #include <iostream>
  2. #include "Vector.h"
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. Vector<int> intVector;
  9.  
  10. cout << "Calling intVector.isEmpty()..." << endl << intVector.isEmpty() << endl << endl;
  11. cout << "Calling intVector.isFull()..." << endl << intVector.isFull()<< endl << endl;
  12. cout << "Calling intVector.getSize()..." << endl << intVector.getSize()<< endl << endl;
  13.  
  14. for (int loop = 0; loop < 10; loop++)
  15. {
  16. intVector.push_back(loop * loop);
  17. }
  18. intVector.pop_back();
  19. cout << "Calling intVector.at(5)..." << endl << intVector.at(5) << endl << endl;
  20.  
  21. Vector<float> floatVector;
  22. cout << "Calling floatVector.isEmpty()..." << endl << floatVector.isEmpty() << endl << endl;
  23. cout << "Calling floatVector.isFull()..." << endl << floatVector.isFull() << endl << endl;
  24. cout << "Calling floatVector.getSize()..." << endl << floatVector.getSize() << endl << endl;
  25.  
  26. for (float loop = 0; loop < 10; loop++)
  27. {
  28. floatVector.push_back(0.35 + loop);
  29. }
  30.  
  31. floatVector.pop_back();
  32. floatVector.pop_back();
  33.  
  34. cout << "The contents of floatVector is: \n\n";
  35. floatVector.print();
  36.  
  37. cout << "Calling floatVector.getSize()..." << endl << floatVector.getSize();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement