title: How to resolve type converting issues
body: <pre><code>namespace learning
  {
      class Gradebook
      {
          public Gradebook()
          {
              grades = new List&lt;float&gt;();  
          }
          public void AddGrade(float grade)
          {
              grades.Add(grade);
          }
          public Gradestatistic compute_statistics()
          {
              Gradestatistic stats = new Gradestatistic();
              float sum = 0f;
              foreach (float grade in grades)
              {
                  sum = sum + grade;
  
              }
              stats.average_grade = sum / grades.Count;
              return stats;
          }
          List&lt;float&gt; grades;
  
  
      }
  }
  </code></pre>
  
  <p>I am using two custom classes Gradebook and Gradestatistic respectively , my object of class gradestatistic is <strong>stats</strong> , average_grade is the member of class gradestatistic, when i built this program it shows error on <strong>stats.average_grade = sum / grades.Count;</strong>  which is <strong>can not implicitly convert type float to learning.gradestatistic</strong> .
  learning is my project name.
  the code of gradestatistic class is </p>
  
  <pre><code>class Gradestatistic
      {
  
          public Gradestatistic highest_grade;
          public Gradestatistic lowestgrade;
          public Gradestatistic average_grade;
      }
  </code></pre>
  
  <p>my program.cs code is </p>
  
  <pre><code>class Program
      {
          static void Main(string[] args)
          {
              Gradebook book = new Gradebook();
              book.AddGrade(91);
              book.AddGrade(89.9f);
              Gradestatistic stats = book.compute_statistics();
  
          }
      }
  </code></pre>