Guest User

Untitled

a guest
Feb 2nd, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #include "vehicles.h"
  2. #include "Car.h"
  3. #include <iostream>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. int vOption;
  11.  
  12. string restart;
  13. string vMake;
  14. string vModel;
  15. double vTopSpeed;
  16. double vEngineSize;
  17. int cNumOfDoors;
  18.  
  19. do{
  20.  
  21. cout << "Welcome to my Vehicles Object Orientated Program!" << endl;
  22. cout << endl;
  23.  
  24. cout << "Select one of the options below to create the vehicle below: " << endl;
  25. cout << "[1] - Car" << endl;
  26. cout << "[2] - Bike" << endl;
  27. cout << endl;
  28. cout << "Choice: ";
  29. cin >> vOption;
  30. cout << endl;
  31.  
  32. if (vOption == 1)
  33. {
  34. cout << "Vehicle Make: ";
  35. cin >> vMake;
  36. cout << " " << endl;
  37.  
  38. cout << "Vehicle Model: ";
  39. cin >> vModel;
  40. cout << endl;
  41.  
  42. cout << "Vehicle Top Speed: ";
  43. cin >> vTopSpeed;
  44. cout << endl;
  45.  
  46. cout << "Vehicle Engine Size: ";
  47. cin >> vEngineSize;
  48. cout << endl;
  49.  
  50. cout << "Vehicle Number Of Doors: ";
  51. cin >> cNumOfDoors;
  52. cout << endl;
  53.  
  54. Car c1 = Car(vMake, vModel, vTopSpeed, vEngineSize, cNumOfDoors);
  55. c1.Display();
  56.  
  57. cout << endl;
  58. }
  59.  
  60. /*
  61. else if (vOption == 2)
  62. {
  63.  
  64. Bikes b1 = Bikes(vMake, vModel, vTopSpeed, vEngineSize);
  65. b1.Display()
  66. }*/
  67.  
  68.  
  69. else
  70. {
  71. cout << "You have not entered a valid option" << endl;
  72. cout << endl;
  73. }
  74.  
  75.  
  76. cout << "Would you like to create another vehicle? (Yes or No): ";
  77. cin >> restart;
  78.  
  79.  
  80. } while (restart == "Yes");
  81.  
  82. cin.ignore(2);
  83. return 0;
  84.  
  85. }
Add Comment
Please, Sign In to add comment