title: C# Calling a method from the main class with parameters
body: <p>So I have this program where basically what I'm trying to do is to generate a random array of 20 elements and then shift the values in it a number of places according to a value inputted by the user. So if the user inputs 5, the array will shift 5 places and the outputted array will have at its first index [0] the value of the index [6] (since index starts from 0 -> 5+1) and at index [1] the value of the original index [7] and so on.</p>
  
  <p>The problem I'm facing lies with the input parameters. I'm trying to give in the value given by the user, so if the user inputs 5 then I give the "shiftValueX" to the method as "_shiftValueX" to work with it. </p>
  
  <p>Yet below at the "ToString" method where I'm printing out the "shiftPos()" method I'm getting this error, "There is no argument given that corresponds to the required formal parameter". What should I do? I tried putting parameters to the method calling at the ToString section but nothing works. Am I calling the method in a wrong way? How can I fix it? Thank you so much.</p>
  
  <p><strong>This is the Class "Arrays"</strong></p>
  
  <pre><code>class Arrays
  {
      //constants
      public const int AMOUNT_OF_VALUES = 20;
      public const int MAX_RND_VALUES = 100;
  
      private int[] array = new int[AMOUNT_OF_VALUES];
  
  
      //Random Generator
      private static Random rnd = new Random();
  
      //Class Constructors
      public Arrays(int[] num)
      {
          for (int i = 0; i &lt; array.Length; i++)
          {
              array[i] = num[i];
          }
      }
  
      public Arrays()
      {
          for (int i = 0; i &lt; array.Length; i++)
          {
              array[i] = rnd.Next(MAX_RND_VALUES);
          }
      }
  
      //Methods
      public int[] shiftPos(int _shiftValueX)
      {
          int y = 0;
          int[] array2 = new int[AMOUNT_OF_VALUES];
  
          for (int i = _shiftValueX; i &lt;= (array.Length - 1); i++)
          {
              array2[y] = array[i];
              y++;
          }
  
          for (int i = 0; i &lt; (array.Length - (_shiftValueX)); i++)
          {
              array2[y] = array[i];
              y++;
          }
  
          return array2;
      }
  
      //Override ToString Method
      public override string ToString()
      {
          return "The original array was: " + string.Join(", ", array.Select(v =&gt; v.ToString())) + "\n" +
                 "The rotated array is: " + string.Join(", ", shiftPos().Select(v =&gt; v.ToString()));
                                //This is where I'm getting the error ^
  
      }
  }
  </code></pre>
  
  <p><strong>This is the "Main Program"</strong></p>
  
  <pre><code>class Program
  {
      //constants
      public const int AMOUNT_OF_VALUES = 20;
  
      static void Main(string[] args)
      {
  
          Console.WriteLine("How many places will the values be shifted: ");
          int shiftValueX = int.Parse(Console.ReadLine());
  
          Arrays myArray = new Arrays();
  
          myArray.shiftPos(shiftValueX);
          Console.WriteLine(myArray);
      }
  }
  </code></pre>