title: everything is correct but cant run :error expected { or ;
body: <p>i cant find where is my error can  u please help me ? the error is expected ; or } but i already put it there i cant run it though.do u  know  why? the drived class is  closed by ; although still the program can not compile . please guide me thanks</p>
  
  <pre><code>  #include &lt;iostream&gt;
      using namespace std;
      class myBase{
            private:
                    int foodmoney;
                    int hobbymoney;
  
                    public:
                 void setdata();
            friend int caldata();
                   };
                   void myBase::setdata(){
                        cout&lt;&lt;"Enter foodmoney :" ;cin&gt;&gt;foodmoney;
                        cout&lt;&lt;"enter hoobymoney:";cin&gt;&gt;hobbymoney;
                        }
                int caldata(int sum,int foodmoney,int hobbymoney){
                          cin&gt;&gt;foodmoney;
                          cin&gt;&gt;hobbymoney;          
                          sum=(foodmoney+hobbymoney)/2;
                          return sum;
  
                               }
  
  
          class Derivedclass:public myBase{
                          int moneyforfood,moneyforhobby;
                          public:
                 int setmydrived(int moneyforfood,int moneyforhobby){
                          cout&lt;&lt;"enter money for food(drived class)"&lt;&lt;endl;
                          cin&gt;&gt;moneyforfood;
                          cout&lt;&lt;"enter money for hobby(drived class)"&lt;&lt;endl;
                          cin&gt;&gt;moneyforhobby;
                          }
  
                          int calculatedrived(){
  
                     int sumd=(moneyforfood+moneyforhobby);
                       cout&lt;&lt;"avg money on frived class "&lt;&lt;sumd&lt;&lt;endl;
                       };
  
  
                      int main(){
                       myBase baseobj;
                       baseobj.setdata();
                       int caldata();
            Derivedclass obj;
                       int setmydrived();
                       obj.calculatedrived();
                        system("puase");
  
           }
  </code></pre>