Advertisement
cska1312

GOLF 4 WITH OOP

Dec 20th, 2022
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.85 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5.   class BasicInformation{
  6.     private:
  7.     string Brand;
  8.     string Model;
  9.     string Generation;
  10.     string Modification;
  11.     string PowerUnitArchitecture;
  12.     string BodyType;
  13.     int NumberOfDoors;
  14.     int NumberOfPlaces;
  15.     int YearOfProduction;
  16.     public:
  17.     void Information(){
  18.       cout << "Brand is: " << Brand << endl;
  19.       cout << "Model is: " << Model << endl;
  20.       cout << "Generation is: " << Generation << endl;
  21.       cout << "Modification is: " << Modification << endl;
  22.       cout << "YearOfProduction is: " << YearOfProduction << " Year" << endl;
  23.       cout << "PowerUnitArchitecture is: " << PowerUnitArchitecture << endl;
  24.       cout << "BodyType is: " << BodyType << endl;
  25.       cout << "NumberOfPlaces is: " << NumberOfPlaces << endl;
  26.       cout << "NumberOfDoors is: " << NumberOfDoors << endl;
  27.     }
  28.  
  29.     BasicInformation(string brand, string model, string generation, string modification, string PUT, string BT, int ND, int NP, int YP){
  30.       Brand=brand;
  31.       Model=model;
  32.       Generation=generation;
  33.       Modification=modification;
  34.       PowerUnitArchitecture=PUT;
  35.       BodyType=BT;
  36.       NumberOfDoors=ND;
  37.       NumberOfPlaces=NP;
  38.       YearOfProduction=YP;
  39.     }
  40.   };
  41.  
  42.   class PerformanceIndicators{
  43.     private:
  44.      string FuelCity;
  45.      string FuelSuburban;
  46.      string Fuel;
  47.      string FuelType;
  48.      int SelerationZeroToHundred;
  49.      int SelerationZeroToSexty;
  50.      string TopSpeed;
  51.      string EnvironmentalStandard;
  52.     public:
  53.      void Indicators(){
  54.        cout << "Fuel in City is: " << FuelCity << endl;
  55.        cout << "Fuel outside the city is: " << FuelSuburban << endl;
  56.        cout << "Combined fuel is: " << Fuel << endl;
  57.        cout << "Type of fuel is: " << FuelType << endl;
  58.        cout << "Аcceleration from 0 to 100 is: "<<SelerationZeroToHundred << endl;
  59.        cout << "Acceleration from 0 to 60 is: " << SelerationZeroToSexty << endl;
  60.        cout << "Max speed is: " << TopSpeed << endl;
  61.        cout << "The environmental standard is: " << EnvironmentalStandard << endl;
  62.      }
  63.      PerformanceIndicators(string FC, string FS, string fuel, string FT, string ES, int ZTOH, int ZTOS, string TS){
  64.          FuelCity=FC;
  65.          FuelSuburban=FS;
  66.          Fuel=fuel;
  67.          FuelType=FT;
  68.          EnvironmentalStandard=ES;
  69.          SelerationZeroToHundred=ZTOH;
  70.          SelerationZeroToSexty=ZTOS;
  71.          TopSpeed=TS;
  72.      }
  73.   };
  74.   class VolumesAndWeights{
  75.     private:
  76.     string OwnMass;
  77.     string AllowableMass;
  78.     string MaximumLoadCapacity;
  79.     string MinimumBootVolume;
  80.     string MaximumBootVolume;
  81.     string TankCapacity;
  82.     public:
  83.     void volumeWeights(){
  84.       cout << "Own mass is: " << OwnMass << endl;
  85.       cout << "Allowable mass is: " << AllowableMass << endl;
  86.       cout << "Maximum load capasity is: " << MaximumLoadCapacity << endl;
  87.       cout << "Minimum boot volume is: " << MinimumBootVolume << endl;
  88.       cout << "Maximum boot volume is: " << MaximumBootVolume << endl;
  89.       cout << "Capacity of tank is: " << TankCapacity << endl;
  90.     }
  91.     VolumesAndWeights(string OM, string AM, string MLC, string MINBV, string MAXBV, string TC){
  92.      OwnMass=OM;
  93.      AllowableMass=AM;
  94.      MaximumLoadCapacity=MLC;
  95.      MinimumBootVolume=MINBV;
  96.      MaximumBootVolume=MAXBV;
  97.      TankCapacity=TC;
  98.     }
  99.   };
  100.   class Dimensions{
  101.     int Length;
  102.     int Width;
  103.     int Height;
  104.     int Wheelbase;
  105.     int FrontTrack;
  106.     int RearTrack;
  107.     int MinimumTurningDiameter;  
  108.     int TyreDimensions;
  109.     int WheelDimensions;
  110.   };
  111.   class Drive{
  112.     private:
  113.     string DriveArchitecture;
  114.     string Propulsion;
  115.     int NumberOfGears;
  116.     public:
  117.     void drive(){
  118.       cout << "Drive archtecture is: " << DriveArchitecture << endl;
  119.       cout << "Drive is: " << Propulsion << endl;
  120.       cout << "Number of gears are: " << NumberOfGears << endl;
  121.     }
  122.     Drive(string DA, string propulsion, int NOFG){
  123.      DriveArchitecture=DA;
  124.      Propulsion=propulsion;
  125.      NumberOfGears=NOFG;
  126.     }
  127.   };
  128.  
  129.   class Brakes{
  130.     private:
  131.     string FrontBrakes;
  132.     string RearBrakes;
  133.     string AuxiliarySystems;
  134.     public:
  135.     void brakes(){
  136.       cout << "Front brakes is: " << FrontBrakes << endl;
  137.       cout << "Rear brakes is: " << RearBrakes << endl;
  138.       cout << "Auxiliary systems are: " << AuxiliarySystems << endl;
  139.     }
  140.     Brakes(string FB, string RB, string AS){
  141.      FrontBrakes=FB;
  142.      RearBrakes=RB;
  143.      AuxiliarySystems=AS;
  144.     }
  145.    };
  146.  
  147.   class Suspension{
  148.     private:
  149.     string FrontSuspension;
  150.     string RearSuspension;
  151.     public:
  152.     void suspension(){
  153.       cout << "Front suspension is: " << FrontSuspension << endl;
  154.       cout << "Rear suspension is: " << RearSuspension << endl;
  155.     }
  156.     Suspension(string FS, string RS){
  157.       FrontSuspension=FS;
  158.       RearSuspension=RS;
  159.     }
  160.   };
  161.  
  162. int main() {
  163.     BasicInformation information=BasicInformation("Volkswagen", "Golf", "Golf IV", "1.9 TDI",  "Internal combustion engine", "Hatchback", 5, 5, 2001);
  164.     information.Information();
  165.  
  166.     cout<<endl;
  167.  
  168.     PerformanceIndicators indicators=PerformanceIndicators("6.5/100km", "4/100km",  "4.9/100km", "Diesel", "Euro 3", 10, 9, "193km/h");
  169.     indicators.Indicators();
  170.  
  171.     cout << endl;
  172.  
  173.     VolumesAndWeights volumesWeights=VolumesAndWeights("1215 kg", "1750 kg", "535 kg", "330 l", "1185 l", "55 l");
  174.     volumesWeights.volumeWeights();
  175.  
  176.     cout << endl;
  177.  
  178.     Drive drive1=Drive("An internal combustion engine (ICE) drives the front wheels", "Front drive", 5);
  179.     drive1.drive();
  180.  
  181.     cout << endl;
  182.  
  183.     Brakes brakes1=Brakes("Disc ventilated", "Disc", "Anti-lock braking system-ABS");
  184.     brakes1.brakes();
  185.  
  186.     cout << endl;
  187.  
  188.     Suspension suspension1=Suspension("McPherson", "Coil spring");
  189.     suspension1.suspension();
  190. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement