title: List creation of double values with UserOption enum
body: <p>I have looked through the archives and didn't find anything that was able to specifically help me understand the problem I'm working through. It is most likely extremely easy but I am finding the structural components of building the program challenging to understand. I think it's the concept of using methods and then calling the results of those methods to Main. </p>
  
  <p>I need to create a List of values, which a user can Add, Sum (+Print result) and Print(as value is entered) - they select this via an enum. The program runs while the user wishes to use any of the above options so there needs to be a loop. </p>
  
  <p>Here is what I have produced so far - there are no errors but there is no 'connectivity' in the code either. My enum works and that's about it. I am unsure how to "call" the methods NewValue, Sum and Print. Any help is greatly appreciated.</p>
  
  <p>UPDATE - I've just looked back through some of the comments up on my updated code and I didn't realise what the correct protocol was when working through answers. I have now updated what I thought was the best response to my question.  </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using SplashKitSDK;
  
  public class Program    
  {
      public static void Main()
      {
          UserOption userSelection;
  
          do
          {
              userSelection = ReadUserOption();
  
              switch (userSelection)
              {
                  case UserOption.NewValue:
                      //NewValue (_values);
                      break;
                  case UserOption.Sum:
                      //Sum ();
                      break;
                  case UserOption.Print:
                      //Print ();
                      break;
                  case UserOption.Quit:
                      Console.WriteLine("Quit");
                      break;
              }
          }
          while (userSelection != UserOption.Quit);
      }
  
      public static UserOption ReadUserOption()
      {
          Console.WriteLine("Enter 0 to add a value");
          Console.WriteLine("Enter 1 to add a sum all values");
          Console.WriteLine("Enter 2 to print a sum all values");
          Console.WriteLine("Enter 3 to quit");
  
          int option = 3;
          Int32.TryParse(Console.ReadLine(), out option);
  
          return (UserOption) option;
      }
  
      public static int ReadInteger(string prompt)
      {
          Console.Write(prompt);
          while (true)
          {
              try
              {
                  return Int32.Parse(Console.ReadLine());
              }
              catch
              {
                  Console.WriteLine("please enter a valid integer");
              }
          }
      }
  
      public static int ReadDouble(string prompt)
      {
          Console.Write(prompt);
          while (true)
          {
              try
              {
                  return Int32.Parse(Console.ReadLine());
              }
              catch
              {
                  Console.WriteLine("please enter a valid double");
              }
          }
      }
  
      public enum UserOption
      {
          NewValue, Sum, Print, Quit
      }
  }
  
  public class List
  {
      private static List&lt;double&gt; _values = new List&lt;double&gt;();
  
      public int Size
      {
          get
          {
              return _values.Count;
          }
      }
  
      public static void NewValue (double value)
      {
          Console.WriteLine("Please enter a value");
          value = Convert.ToDouble(Console.ReadLine());
          _values.Add(value);
      }
  
      public static void Print()
      {
          foreach (double value in _values)
          {
              Console.WriteLine(value);
          }
      }
  
      public static void Sum()
      {
          double sum = 0;
  
          foreach (double value in _values)
          {
              sum = sum + (value);
          }
  
          Console.WriteLine($"Sum of all elements in the list is {sum}");
      }   
  }
  </code></pre>