title: How to Calculate the distance passed by a car for a day, and for entire month
body: <p>So I  have three classes such as :</p>
  
  <pre><code>internal class Checkpoint
  {
      public int Id { get; set; }
      public string Coordinates { get; set; }
  }
  
  internal class Log
  {
      public DateTime TimeStamp { get; set; }
      public int CheckpointId { get; set; }
  
  }
  
  internal class User
  {
      public int Id { get; set; }
      public string Coordinate { get; set; }
      public string Name { get; set; }
  
  }
  </code></pre>
  
  <p>And I want to calculate the distcane the Car travels per day according to the registration points. If the user is registered at point A only, I get the coordinates of his home and calculate the distance between his home, the checking point A and back to his home.
  If he is registered in Point A and B , I take the coordinates from Home to A to B and then Back to Home.</p>
  
  <p>So my program is as follows :</p>
  
  <pre><code>static void Main(string[] args)
      {
  
  
          var listOfUsers = new List&lt;User&gt;(); //get users from db
          var listOfCheckpoints = new List&lt;Checkpoint&gt;(); //get checkpoints from db
          StringBuilder sb = new StringBuilder();
          foreach (var user in listOfUsers)
          {
              string address = user.Coordinate;
  
              DateTime currentDate = new DateTime(2014, 8, 1);
              var dictionary = new Dictionary&lt;string, double&gt;();
  
              while (currentDate &lt;= DateTime.Now)
              {
                  double dayUserDistance = 0.00;
                  var listOfUserLogs = new List&lt;Log&gt;(); //Get logs where day == currentDate from db
                  var previousCoordinate = address;
                  foreach (var log in listOfUserLogs)
                  {
  
                      Checkpoint checkpoint = listOfCheckpoints.FirstOrDefault(x =&gt; x.Id == log.CheckpointId);
  
  
                      dayUserDistance += DistanceCalculator.GetDistance(previousCoordinate, checkpoint.Coordinates);
                      previousCoordinate = checkpoint.Coordinates;
  
                  }
                  dayUserDistance += DistanceCalculator.GetDistance(previousCoordinate, address);
  
                  dictionary.Add(currentDate.ToString("yyyy-MM-dd"), dayUserDistance);
  
                  currentDate = currentDate.AddDays(1);
              }
  
              sb.Append(user.Name + " ; ");
              foreach (KeyValuePair&lt;string, double&gt; keyValuePair in dictionary)
              {
                  sb.Append(keyValuePair.Value + ";");
              }
              sb.AppendLine();
          }
          Console.WriteLine();
          Console.ReadLine();
      }
  }
  </code></pre>
  
  <p>But when I run it I don't get anything printed in the Console. The console is blank.</p>
  
  <p>Can you please let me know what I am missing. I have connected the database to the console app, since I have all the data needed in the database.</p>