Guest User

Untitled

a guest
Jun 1st, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.90 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int Option;
  6. bool Exit = false;
  7. char Input[10];
  8. char P, p;
  9. char D, d;
  10. char Requirement[10];
  11.  
  12. void BookingMainMenu(); //Booking Main Menu Function
  13.  
  14. void BookingSportsCar(); //Sports Car Booking Function
  15.  
  16. void Booking4x4(); //4x4 Booking Function
  17.  
  18. void BookingVan(); //Van Booking Function
  19.  
  20. void ViewingMainMenu(); //Viewing Main Menu Function
  21.  
  22. void ViewingSportsCar(); //Viewing Sports Car Function
  23.  
  24. void Viewing4x4(); //Viewing 4x4 Function
  25.  
  26. void ViewingVan(); //Viewing Van Function
  27.  
  28. class AllCars{
  29.       public:
  30.              int TotalMilesDriven;
  31.              int TankFillingAccumulation;
  32.              int NumberOfRepairs;
  33.              int TaxRate;
  34.              char InsuranceGroup[1];
  35.              int TyreChangeCount;
  36.              int DateBookedOut;
  37.              int NumberOfDaysBooked;
  38.              char FuelType[6];
  39.              char CarRegistration[7];
  40.              char FuelTankSize[4];
  41.              char MainFuelCapacity[4];
  42.              int NumberOfSeats;
  43.              
  44.              float MilesPerGallon();
  45.              int RepairsPerMile();
  46.              float AveMilesUsed();
  47.  
  48.              AllCars(int totalmilesdriven, int tankfillingaccumulation, int numberofrepairs, int taxrate, char insurancegroup[1], int tyrechangecount, int datebookedout, int numberofdaysbooked, char fueltype[6], char carregistration[7], char fueltanksize[4], char mainfuelcapacity[4], int numberofseats ){
  49.                    TotalMilesDriven = totalmilesdriven;
  50.                    TankFillingAccumulation = tankfillingaccumulation;
  51.                    NumberOfRepairs = numberofrepairs;
  52.                    TaxRate = taxrate;
  53.                    InsuranceGroup[1] = insurancegroup[1];
  54.                    TyreChangeCount = tyrechangecount;
  55.                    DateBookedOut = datebookedout;
  56.                    NumberOfDaysBooked = numberofdaysbooked;
  57.                    FuelType[6] = fueltype[6];
  58.                    CarRegistration[7] = carregistration[7];
  59.                    FuelTankSize[4] = fueltanksize[4];
  60.                    MainFuelCapacity[4] = mainfuelcapacity[4];
  61.                    NumberOfSeats = numberofseats;
  62.              }
  63.  
  64.              };
  65.              
  66. //Cars For Hire
  67. AllCars SportsCar1(0, 450, 0, 10, "S", 1, 00-00-00, 0, "Petrol", "MA01 CAR", "100 Litres", "60 Litres", 2);
  68. AllCars SportsCar2(0, 450, 0, 10, "SD", 1, 00-00-00, 0, "Diesel", "MA02 CAR", "120 Litres", "70 Litres", 4);
  69. AllCars SportsCar3(0, 450, 0, 10, "S", 1, 00-00-00, 0, "Petrol", "MA03 CAR", "100 Litres", "60 Litres", 4);
  70. AllCars SportsCar4(0, 450, 0, 10, "SD", 1, 00-00-00, 0, "Diesel", "MA04 CAR", "120 Litres", "70 Litres", 5);
  71.  
  72. AllCars FourByFourCar1(0, 600, 1, 10, "O", 2, 00-00-00, 0, "Petrol", "MA05 CAR", "150 Litres", "80 Litres", 4);
  73. AllCars FourByFourCar2(0, 600, 1, 10, "OD", 2, 00-00-00, 0, "Diesel", "MA06 CAR", "170 Litres", "100 Litres", 4);
  74. AllCars FourByFourCar3(0, 600, 1, 10, "O", 2, 00-00-00, 0, "Petrol", "MA07 CAR", "150 Litres", "80 Litres", 5);
  75. AllCars FourByFourCar4(0, 600, 1, 10, "OD", 2, 00-00-00, 0, "Diesel", "MA08 CAR", "170 Litres", "100 Litres", 5);
  76.  
  77. AllCars Van1(0, 800, 0, 10, "V", 1, 00-00-00, 0, "Petrol", "MA09 CAR", "100 Litres", "50 Litres", 2);
  78. AllCars Van2(0, 800, 0, 10, "VD", 1, 00-00-00, 0, "Diesel", "MA10 CAR", "110 Litres", "60 Litres", 2);
  79. AllCars Van3(0, 800, 0, 10, "V", 1, 00-00-00, 0, "Petrol", "MA11 CAR", "100 Litres", "50 Litres", 4);
  80. AllCars Van4(0, 800, 0, 10, "VD", 1, 00-00-00, 0, "Petrol", "MA12 CAR", "110 Litres", "60 Litres", 4);
  81.              
  82.              
  83. class SportsCars{
  84.       public:
  85.              bool SoftTop;
  86.              bool Alloys;
  87.              };
  88.              
  89. class FourByFour{
  90.       public:
  91.              bool OffRoad;
  92.              bool TowingHitch;
  93.              };
  94.              
  95. class Vans{
  96.       public:
  97.              bool HighTop;
  98.              };
  99.              
  100. int main(){
  101.     system ("cls");
  102.     cout << "!================== Welcome To Matt's Auto's ==================!" << endl;
  103.     cout << "\n";
  104.     cout << "!========== Please Select The Option You Wish To Use ==========!" << endl;
  105.     cout << "\n";
  106.     cout << "1) Book A Vehicle" << endl << "2) View Our Vehicles" << endl << "3) Exit" << endl;
  107.     cout << "\n";
  108.     cin >> Option;
  109.    
  110.     while(!Exit){
  111.                  
  112.     switch(Option){
  113.                    case 1:{
  114.                         BookingMainMenu();
  115.                         break;
  116.                         }
  117.                    case 2:{
  118.                         ViewingMainMenu();
  119.                         break;
  120.                         }
  121.                    case 3:{
  122.                         Exit = true;
  123.                         break;
  124.                         }
  125.                    default:{
  126.                    
  127.                    }
  128.                    }  
  129.     }
  130.        
  131.     return 0;
  132. }
  133.  
  134. void BookingMainMenu(){
  135.      system ("cls");
  136.      cout << "!======================== Book A Car ==========================!" << endl;
  137.      cout << "\n";
  138.      cout << "!========== Please Select From The Following Options ==========!" << endl;
  139.      cout << "\n";
  140.      cout << "1) Book A Sports Car" << endl << "2) Book A 4x4" << endl << "3) Book A Van" << endl;
  141.      cin >> Option;
  142.      system("PAUSE");
  143.      
  144.      if (Option == 1){
  145.           BookingSportsCar();
  146.           }
  147.      else if (Option == 2){
  148.           Booking4x4();
  149.           }
  150.      else if (Option == 3){
  151.           BookingVan();
  152.           }
  153.      }
  154.      
  155. void BookingSportsCar(){
  156.      system ("cls");
  157.      cout << "!==================== Sports Car Booking Form ====================!" << endl;
  158.      cout << "\n";
  159.      cout << "!============= Please Answer The Following Questions =============!" << endl;
  160.      cout << "\n";
  161.      cout << "What Fuel Type Would You Like?" << endl;
  162.      cout << "\n";
  163.      cout << "1) Petrol" << endl << "2) Diesel" << endl;
  164.      cin >> Input[0];
  165.         if (Input[0] == '1'){
  166.         Requirement[0] == "Petrol";
  167.         }
Advertisement
Add Comment
Please, Sign In to add comment