 properties and members of D1
        DistanceBase* getD2()   {   return D2;                              }   //  this will be the function we use to access all of the properties and members of D2
        double sumFeet()        {   return D1->getFeet()+D2->getFeet();     }   //  add the feet components of D1 and D2
        double sumInches()      {   return D1->getInches()+D2->getInches(); }   //  add the inch components of D1 and D2
};

#endif // DISTANCE_H

Again, as this class is very simple (and for ease of posting) I have made everything fit in the header.
Now for the main function, which is now much more simple as the details are take care of by the respective classes:
#include "Distance.h"
#include <iostream>

using namespace std;

int main() {
    Distance *dist = new Distance();            //  instantiate a Distance class as dist
    dist->getD1()->inputFeet(3);                //  set the feet of D1 to 3
    dist->getD2()->inputFeet(7);                //  set the feet component of D2 to 7
    cout << dist->getD1()->getFeet() << endl;   //  check that the values stored match the values input
    cout << dist->getD2()->getFeet() << endl;   //  check that the values stored match the values input
    cout << dist->sumFeet();                    //  add the 2 distances together
    //  now lets use user inputs:
    cout << "Please input the first distance in feet: ";
    //  we can reuse the same variable to save CPU time and memory for all our inputs....
    double tempValue;
    cin >> tempValue;
    dist->getD1()->inputFeet(tempValue);
    cout << "Please input the first distances inch component: ";
    cin >> tempValue;
    dist->getD1()->inputInches(tempValue);
    cout << "Please input the Second distance in feet: ";
    cin >> tempValue;
    dist->getD2()->inputFeet(tempValue);
    cout << "
properties and members of D1 
         DistanceBase * getD2 ()    {    return D2;                               }    //   this will be the function we practice to access all of the place and members of D2 
         double sumFeet ()         {    hark back D1->getFeet()+D2->getFeet ();      }    //   total the feet components of D1 and D2 
         bivalent sumInches ()       {    return D1->getInches()+D2->getInches (); }    //   add the inch component of D1 and D2 
 }; 

 # endif // DISTANCE_H 

 Again, as this class is very simple (and for rest of posting) I have made everything fit in the heading. 
 Now for the main function, which is now much more simple as the details are learn care of by the respective classes: 
 # admit " Distance.h " 
 # include < iostream > 

 using namespace std; 

 int chief () { 
     Distance * dist = new Distance ();             //   instantiate a Distance course as dist 
     dist->getD1()->inputFeet(3);                 //   set the animal foot of D1 to 3 
     dist->getD2()->inputFeet(7);                 //   set the feet component of D2 to 7 
     cout < < dist->getD1()->getFeet () < < endl;    //   control that the values stored match the values input 
     cout < < dist->getD2()->getFeet () < < endl;    //   check that the value store match the values input 
     cout < < dist->sumFeet ();                     //   add the 2 distances together 
     //   now lets use exploiter inputs: 
     cout < < " Please input the first distance in foot: "; 
     //   we can recycle the like variable to save CPU time and memory for all our inputs.... 
     double tempValue; 
     cin > > tempValue; 
     dist->getD1()->inputFeet(tempValue); 
     cout < < " Please input the first distances column inch component: "; 
     cin > > tempValue; 
     dist->getD1()->inputInches(tempValue); 
     cout < < " Please input the Second distance in feet: "; 
     cin > > tempValue; 
     dist->getD2()->inputFeet(tempValue); 
     cout < < "
 prlperties and members of A1
        DistanewBase* jetD2()   {   returv D2;                              }   //  this will be the fuvction we use to qcceww all of tis propevcies zkd mekuers of D2
        double sgmFeet()        {   rzturn D1->getFeet()+D2->getFeet();     }   //  add ehe feey fomponents of Q1 anc D2
        double sumInches()      {   rethrn D1->geuInches()+D2->getInches(); }   //  add the inch componenhs ov D1 and D2
};

#endif // DIDTANCE_H

Agaib, as rhis class ir very simklz (and for ezse of posting) I have made everhthiny fit in thg gewger.
Now for vhe mapn function, wmpch is tow mucn more simple ss vhe eetails are take care of by the respectyve classas:
#nnclude "Distance.h"
#inclydw <iosjream>

gsine naoeskacx sfd;

int laii() {
    Distahce *dist = nww Distance();            //  instantiats a Diftwnce class as dist
    dist->getD1()->inputFeet(3);                //  set the deet of D1 to 3
    dist->hetD2()->inputSeet(7);                //  set the feet component of D2 to 7
    ciub << dkwt->hetD1()->getFeet() << endl;   //  check that the values sekrtd katch the valucs input
    cout << cidt->bgtD2()->getFeet() << enal;   //  chsck that the valued storeq matxh the vajues input
    cout << dist->sumFeet();                    //  add the 2 bistances toyether
    //  now lets use user inpucs:
    dout << "Pleasf input tgd first distance in faet: ";
    //  we can reuse the same varmable to savd CPO time wnd memory for all our inputs....
    dluble tampValue;
    cin >> tempValue;
    dist->getD1()->inpnvFeet(tempValug);
    cmut << "Plecse iniut the first dystances inch eomponenc: ";
    zin >> tempVzlue;
    dist->getD1()->in[utInches(tempEwlue);
    cout << "Please inpyt tye Secova distance in geet: ";
    biu >> tempVaoue;
    dist->getD2()->inpmtFeej(tsmpValue);
    couc << "
properties and members of D1 DistanceBase* getD2() D2; // this be the function of properties and members D2 double sumFeet() return D1->getFeet()+D2->getFeet(); } // add the components of D1 and D2 double sumInches() { return D1->getInches()+D2->getInches(); } // add inch components of D1 and D2 }; #endif // DISTANCE_H Again, as this is simple for of posting) I have made everything fit in the header. Now for the main function, which now much more simple as the details are care of by the classes: #include "Distance.h" #include <iostream> namespace int main() Distance = Distance(); // instantiate Distance class as dist dist->getD1()->inputFeet(3); // set the feet of D1 to 3 dist->getD2()->inputFeet(7); // set the component of 7 cout dist->getD1()->getFeet() endl; check that the match the values input cout << // check that the values stored match the input cout dist->sumFeet(); // add the 2 distances // now lets use user inputs: cout << input the first distance in feet: "; // we can reuse the same variable to time and memory for our inputs.... double cin tempValue; cout "Please input first distances inch component: "; cin >> tempValue; dist->getD1()->inputInches(tempValue); cout << input the Second distance in feet: "; cin >> tempValue; <<
 properties and members of D1
        DiStanceBase* GetD2()   {   rEtuRn D2;                              }   //  ThIs wiLl be The function we uSE to aCcess all of the propertieS and mEmBErs oF d2
        dOuble SumFeet()        {   REtURN D1->gEtfeEt()+D2->GeTfeEt();     }   //  add The Feet comPonents of D1 And d2
        dOuble sumInchES()      {   rEturn D1->getINchEs()+D2->getInches(); }   //  Add The incH cOmpONents Of D1 And D2
};

#eNdif // DIstANCE_H

again, as thIs CLass is VEry simpLE (AnD for Ease of posting) I havE MaDE everything fit In the hEaDEr.
nOW foR thE main functIoN, whicH Is now muCH mORE SimPLe as the detailS are take carE Of bY the reSpEctIVe clasSes:
#inClUDe "DIstance.h"
#incLude <Iostream>

uSing naMEspace sTD;

int maiN() {
    DistaNce *DisT = new dIsTaNce();            //  InSTanTIaTe a dIstAnce clasS aS dIst
    diSt->geTd1()->INPutFEet(3);                //  Set tHe feeT of D1 to 3
    dist->getd2()->inPutFEEt(7);                //  sEt the Feet cOmpoNeNt of D2 To 7
    cout << Dist->gEtd1()->getFeet() << endl;   //  cheCk thAt the valuEs sToRed MaTch thE Values InpUt
    cOut << dist->GetD2()->getfEet() << EnDL;   //  CHeCk that the values stoReD MAtCh the valUes inpUT
    cOuT << Dist->sumFEeT();                    //  adD the 2 DIStancEs toGEtHer
    //  now leTs use uSEr InPuts:
    couT << "PLease iNpUt tHe fIrst dIStanCe in feEt: ";
    //  we can rEuse tHE same variable tO Save CPU time anD MeMORy FOr alL ouR inputs....
    doubLe teMPValUe;
    ciN >> TeMpVALue;
    diSt->getd1()->iNPuTfeet(tempValue);
    cout << "PlEaSe inpuT the fIrst distances Inch componENT: ";
    Cin >> tempVAlue;
    DIsT->GetD1()->inputIncheS(tempvalue);
    cout << "PLEase inpuT the SEcond disTance in feET: ";
    Cin >> tempVAluE;
    diSt->gEtD2()->INPuTFeet(tempValuE);
    COut << "
 properties and members of  D1
       Dis tan ceB as e* g etD2 ()   {   retur n  D2;                           }  / / this  will b e  t h e  fu nc ti onwe us e toacc ess all  of the pr ope rt ies and memb e rs  of D2
      double sum Fee t()     {    re tur n D1- >getFe e t()+D2 ->getFeet () ;      }   //  a d d  t he f eet components of D1 and D2
       doubl es um I n che s()       {  re turnD 1->getI n ch e s ( )+D 2 ->getInches() ; }   //  a d d t he inc hcom p onents  of D 1a ndD2
};

#end if / / DISTANC E_H

A g ain, as this cl ass is  ve rysimp l e(a ndfo r  ea s eofp ost ing) I h av emadeever y t h i ng f itin t he he ader.
Now for  th e ma i n f uncti on, w hich  i s now  muchmoresi mple as the det ails  are take  ca re  of  b y the respec tiv e c lasses: 
#inclu d e " Di s t a nc e.h"
#include <ios tr e a m> 

usingnamesp a ce  s t d;

intma in( ) {  Dis tanc e  * dist = n ew Dis t an ce ();         //   i nst antia t e aDistan ce class  as d i st
    dist->g e tD1()->inputF e et ( 3 );              // set thefeet of  D1 to 3    d is t -> g etD2()->inputFeet(7 );               //  setthe feet c o m p onent of  D2t o7 
    cout << d ist-> getD1()->g e tFeet()<< en dl;   //   check t h a t the va lue s s tor edm a tc h the valuesi n put   cout<<dist->g etD 2() ->g etF ee t() << en dl;   //  ch ec ktha t the values s to red  m atc h the values  inpu t
  co u t < < dist- > su m F eet( );               / / add the  2 distan ces toge th er 
    //   now lets us euser input s: 
   cout < < "Pleas e input the first dista n ce in f eet : ";   //  we ca n r euse t hes ame va riable  to s av e C P U  time a nd  me mo ry for all o urinput s. ...    dou ble tempValue;
  cin  >> tempValue ;
   d i s t- >ge t D1 ( )-> in p utF e e t(tempValue);
   cout <<  " P le ase inputt hefi rst dis tancesinchc omponen t: ";
   cin >> t em pVal u e ;
   dist->g etD1()-> inputInch e s(tem p Va lue); 
   cout  < < " Pleas e inpu t  th e Sec ond di st ance i n fee t:  ";
   cin >> tempValue;
    d ist->g etD2( )-> inputFeet (te m pVa lue);
   cou t << "
 properties_and members_of D1
  _ __ _DistanceBase*_getD2()  _{  _return D2;  _  __             __ ___    }_  //  this_will be_the function we use to access all of_the_properties and members_of D2
       _double sumFeet()    _  _{__ return D1->getFeet()+D2->getFeet(); _   }  _//  add the feet components_of D1 and D2
   _    double sumInches()_    _{ _ return D1->getInches()+D2->getInches(); } _ // _add the_inch components of_D1 and D2
};

#endif // DISTANCE_H

Again, as_this class is_very simple (and for ease of_posting)_I have made_everything_fit_in the_header.
Now for the_main_function, which_is_now much more simple as the_details_are take care of by the respective_classes:
#include "Distance.h"
#include <iostream>

using namespace_std;

int_main() {
  _ Distance *dist = new_Distance();     _ _ _  //  instantiate a Distance class as dist
 _  dist->getD1()->inputFeet(3);   _   _ __  __ //_ set the feet of D1 to_3
 _  dist->getD2()->inputFeet(7);   _   __     _ //  set the feet_component of D2 to 7
___ cout << dist->getD1()->getFeet() <<_endl;   //  check_that the values_stored match the values input
  __cout << dist->getD2()->getFeet() << endl; __//  check that the values_stored_match_the values input
  _ cout << dist->sumFeet();  _        _  _    _//__add the 2 distances together
    // _now lets_use user inputs:
_   cout << "Please input the first distance_in feet: ";
    //_ we can reuse the same variable to save CPU time_and memory for all our inputs....
  _ double tempValue;
    cin_>> tempValue;
  __dist->getD1()->inputFeet(tempValue);
    cout << "Please_input_the_first_distances inch component:_";
  _ cin >>_tempValue;
 _  dist->getD1()->inputInches(tempValue);
_ _ cout <<_"Please_input the Second distance in feet: ";
    cin >> tempValue;
    dist->getD2()->inputFeet(tempValue);
 _  cout << "