Guest User

Problems With Variable Data

a guest
Jun 1st, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.37 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;
  9.  
  10. void BookingMainMenu(); //Booking Main Menu Function
  11.  
  12. void BookingSportsCar(); //Sports Car Booking Function
  13.  
  14. void Booking4x4(); //4x4 Booking Function
  15.  
  16. void BookingVan(); //Van Booking Function
  17.  
  18. class AllCars{
  19.       public:
  20.              int TotalMilesDriven;
  21.              int TankFillingAccumulation;
  22.              int NumberOfRepairs;
  23.              int TaxRate;
  24.              char InsuranceGroup[1];
  25.              int TyreChangeCount;
  26.              int DateBookedOut;
  27.              int NumberOfDaysBooked;
  28.              char FuelType[6];
  29.              char CarRegistration[7];
  30.              char FuelTankSize[4];
  31.              char MainFuelCapacity[4];
  32.              int NumberOfSeats;
  33.              
  34.              float MilesPerGallon();
  35.              int RepairsPerMile();
  36.              float AveMilesUsed();
  37.  
  38.              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 ){
  39.                    TotalMilesDriven = totalmilesdriven;
  40.                    TankFillingAccumulation = tankfillingaccumulation;
  41.                    NumberOfRepairs = numberofrepairs;
  42.                    TaxRate = taxrate;
  43.                    InsuranceGroup[1] = insurancegroup[1];
  44.                    TyreChangeCount = tyrechangecount;
  45.                    DateBookedOut = datebookedout;
  46.                    NumberOfDaysBooked = numberofdaysbooked;
  47.                    FuelType[6] = fueltype[6];
  48.                    CarRegistration[7] = carregistration[7];
  49.                    FuelTankSize[4] = fueltanksize[4];
  50.                    MainFuelCapacity[4] = mainfuelcapacity[4];
  51.                    NumberOfSeats = numberofseats;
  52.              }
  53.  
  54.              };
  55.              
  56.              
  57.              
  58. class SportsCars{
  59.       public:
  60.              bool SoftTop;
  61.              bool Alloys;
  62.              };
  63.              
  64. class FourByFour{
  65.       public:
  66.              bool OffRoad;
  67.              bool TowingHitch;
  68.              };
  69.              
  70. class Vans{
  71.       public:
  72.              bool HighTop;
  73.              };
  74.              
  75. int main(){
  76.     system ("cls");
  77.     cout << "!================== Welcome To Matt's Auto's ==================!" << endl;
  78.     cout << "\n";
  79.     cout << "!========== Please Select The Option You Wish To Use ==========!" << endl;
  80.     cout << "\n";
  81.     cout << "1) Book A Vehicle" << endl << "2) View Our Vehicles" << endl << "3) Exit" << endl;
  82.     cout << "\n";
  83.     cin >> Option;
  84.    
  85.     while(!Exit){
  86.                  
  87.     switch(Option){
  88.                    case 1:{
  89.                         BookingMainMenu();
  90.                         break;
  91.                         }
  92.                    case 2:{
  93.                        
  94.                         break;
  95.                         }
  96.                    case 3:{
  97.                         Exit = true;
  98.                         break;
  99.                         }
  100.                    default:{
  101.                    
  102.                    }
  103.                    }  
  104.     }
  105.        
  106.     return 0;
  107. }
  108.  
  109. void BookingMainMenu(){
  110.      system ("cls");
  111.      cout << "!======================== Book A Car ==========================!" << endl;
  112.      cout << "\n";
  113.      cout << "!========== Please Select From The Following Options ==========!" << endl;
  114.      cout << "\n";
  115.      cout << "1) Book A Sports Car" << endl << "2) Book A 4x4" << endl << "3) Book A Van" << endl;
  116.      cin >> Option;
  117.      system("PAUSE");
  118.      
  119.      if (Option == 1){
  120.           BookingSportsCar();
  121.           }
  122.      else if (Option == 2){
  123.           Booking4x4();
  124.           }
  125.      else if (Option == 3){
  126.           BookingVan();
  127.           }
  128.      }
  129.      
  130.     // AllCars car;
  131.      
  132. void BookingSportsCar(){
  133.      system ("cls");
  134.      cout << "!==================== Sports Car Booking Form ====================!" << endl;
  135.      cout << "\n";
  136.      cout << "!============= Please Answer The Following Questions =============!" << endl;
  137.      cout << "\n";
  138.      cout << "What Fuel Type Would You Like?" << endl;
  139.      cout << "\n";
  140.      cout << "1) Petrol" << endl << "2) Diesel" << endl;
  141.      cin >> Input[0];
  142.         if (Input[0] == 1){
  143.             AllCars.FuelType == "Petrol";
  144.         }
Advertisement
Add Comment
Please, Sign In to add comment