Sheep counting - But I cannot, could you help me??

 

Dear friends,

This is a sample regarding the usage of operator "continue" from https://book.mql4.com/operators/continue. I have a slight change in the coding resulting in different outputs. Could you enlighten me how the difference occur?

Problem 16. There are 1000 sheep on the first farm. The amount of sheep on the first farm increases by 1% daily. If the amount of sheep exceeds 50 000 at the end of month, then 10% of sheep will be transferred to the second farm. Within what time will the amount of sheep on the second farm reach 35 000? (We consider that there are 30 working days in a month.)

int start()                               
  {
//--------------------------------------------------------------------
   int
   day,                                   
   Mons;                                  
   double
   One_Farm    =1000.0,                   
   Perc_day    =1,                        
   One_Farm_max=50000.0,                  
   Perc_exit   =10,                      
   Purpose     =35000.0,                  
   Two_Farm;                              
//--------------------------------------------------------------------
   while(Two_Farm < Purpose)              
     {                                   
      //--------------------------------------------------------------
      for(day=1; day<=30; day++)          
         One_Farm=One_Farm*(1+Perc_day/100);
      //--------------------------------------------------------------
      Mons++;                             
      if (One_Farm < One_Farm_max)        
         continue;                        
      
      Two_Farm=Two_Farm+One_Farm*Perc_exit/100;
      One_Farm=One_Farm*(1-Perc_exit/100);
      
      
     }                                    
//--------------------------------------------------------------------
   Alert("The aim will be attained within ",Mons,"month");
   Alert("The last One_Farm:", One_Farm);
   Alert("The last Two_Farm:", Two_Farm);
   return;                                
  }
//--------------------------------------------------------------------

Here I just wanna change if (One_Farm < One_Farm_max) to if (One_Farm >= One_Farm_max). Below is my coding,

//--------------------------------------------------------------------

//--------------------------------------------------------------------
int start()                               
  {
//--------------------------------------------------------------------
   int
   day,                                   
   Mons;                                  
   double
   One_Farm    =1000.0,                   
   Perc_day    =1,                        
   One_Farm_max=50000.0,                  
   Perc_exit   =10,                      
   Purpose     =35000.0,                  
   Two_Farm;                              
//--------------------------------------------------------------------
   while(Two_Farm < Purpose)              
     {                                   
      //--------------------------------------------------------------
      for(day=1; day<=30; day++)          
         One_Farm=One_Farm*(1+Perc_day/100);
      //--------------------------------------------------------------
      Mons++;                             
      if (One_Farm >= One_Farm_max)        
         //continue;                        
      
      Two_Farm=Two_Farm+One_Farm*Perc_exit/100;
      One_Farm=One_Farm*(1-Perc_exit/100);
      
      
     }                                    
//--------------------------------------------------------------------
   Alert("The aim will be attained within ",Mons,"month");
   Alert("The last One_Farm:", One_Farm);
   Alert("The last Two_Farm:", Two_Farm);
   return;                                
  }
//--------------------------------------------------------------------

But the outputs are totally different. Maybe something wrong with the expression for If operator, so I have some modification as below (adding two braces).

//--------------------------------------------------------------------

//--------------------------------------------------------------------
int start()                               
  {
//--------------------------------------------------------------------
   int
   day,                                   
   Mons;                                  
   double
   One_Farm    =1000.0,                   
   Perc_day    =1,                        
   One_Farm_max=50000.0,                  
   Perc_exit   =10,                      
   Purpose     =35000.0,                  
   Two_Farm;                              
//--------------------------------------------------------------------
   while(Two_Farm < Purpose)              
     {                                   
      //--------------------------------------------------------------
      for(day=1; day<=30; day++)          
         One_Farm=One_Farm*(1+Perc_day/100);
      //--------------------------------------------------------------
      Mons++;                             
      if (One_Farm >= One_Farm_max)        
         //continue;                        
      {
      Two_Farm=Two_Farm+One_Farm*Perc_exit/100;
      One_Farm=One_Farm*(1-Perc_exit/100);
      }
      
     }                                    
//--------------------------------------------------------------------
   Alert("The aim will be attained within ",Mons,"month");
   Alert("The last One_Farm:", One_Farm);
   Alert("The last Two_Farm:", Two_Farm);
   return;                                
  }
//--------------------------------------------------------------------

Lucky, the outputs are the same as original ones but I am not quite clear about the caculation in the cycle. To be simple, what is the difference between below 2 expressions in the while cycle??

 
      if (One_Farm >= One_Farm_max)        
         //continue;                        
      
      Two_Farm=Two_Farm+One_Farm*Perc_exit/100;
      One_Farm=One_Farm*(1-Perc_exit/100);

      if (One_Farm >= One_Farm_max)        
         //continue;                        
      {
      Two_Farm=Two_Farm+One_Farm*Perc_exit/100;
      One_Farm=One_Farm*(1-Perc_exit/100);
      }