Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. void DisplayAllVehicles(vector<Truck> &tr,vector<Car> &cr,vector<Motorcycle> &mr) {
  2.  
  3. int Displaysetup = 0;
  4. bool DisplayEXIT = false;
  5.  
  6. while (!DisplayEXIT) {
  7. cout << " What type of Vehicle would u like to Display? " << endl << endl;
  8. cout << " 1. Trucks" << endl;
  9. cout << " 2. Cars" << endl;
  10. cout << " 3. Motorcycles" << endl;
  11. cout << " 4. Exit" << endl;
  12. cin >> Displaysetup;
  13.  
  14. switch (Displaysetup) {
  15. case(1):
  16. cout << " **************************** " << endl;
  17. cout << "================* Trucks Information: *================" << endl;
  18. cout << " **************************** " << endl << endl << endl;
  19. for (
  20. int i = 0;
  21. i < tr.size();
  22. i++) {
  23. tr[i].DisplayTruckDetails();
  24. }
  25. DisplayEXIT = true;
  26. break;
  27. case(2):
  28. cout << " **************************** " << endl;
  29. cout << "================* Cars Information: *================" << endl;
  30. cout << " **************************** " << endl << endl << endl;
  31. for (
  32. int i = 0;
  33. i < cr.size();
  34. i++) {
  35. cr[i].DisplayCarDetails();
  36. }
  37. DisplayEXIT = true;
  38. break;
  39. case(3):
  40. cout << " **************************** " << endl;
  41. cout << "================* Motorcycles Information: *================" << endl;
  42. cout << " **************************** " << endl << endl << endl;
  43. for (
  44. int i = 0;
  45. i < mr.size();
  46. i++) {
  47. mr[i].DisplayMotorcycleDetails();
  48. }
  49. DisplayEXIT = true;
  50. break;
  51. case(4):
  52. DisplayEXIT = true;
  53. break;
  54. default:
  55. cout << "Invalid Selection" << endl;
  56. cin.clear();
  57. cin.ignore();
  58. }
  59.  
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement