title: How do I pass the user inputs to a constructor in a different class?
body: <p>My professor told me that I have to Design a class "SharePattern" that has the following two fields: "numberOfDaysInPeriod" and
  "SharePointsOnFirstDay". </p>
  
  <p>The class should have a constructor to set the values of these two fields. </p>
  
  <p>In a separate class he said to get user input in the main of my other class. So what goes into the constructor?</p>
  
  <p>First class:</p>
  
  <pre><code>public static void main(String[] args) {
      // TODO Auto-generated method stub
      Scanner more = new Scanner(System.in);
      System.out.print("Number of days in the period: ");
      int input1 = more.nextInt();
      while(input1 &lt; 10 || input1 &gt; 20)
      {
          System.out.println("The number of days that is entered must not be less than 10 and more than 20. The number of days doesn't meet the required criteria, enter it again");
          System.out.print("Number of days in the period: ");
          input1 = more.nextInt();
      }
  
      System.out.print("Share points on the first day: ");
      int input2 = more.nextInt();
      int half = input1 / 2;
      more.close();
  
  
      SharePattern sp = new SharePattern(input1, input2, half);
      sp.findFinalDaySharePoints(input1, input2, half);
  }
  }
  </code></pre>
  
  <p>2nd class:</p>
  
  <pre><code>package hw4Question2;
  
  public class SharePattern {
  
      public SharePattern(int input1, int input2, int half)//constructor
      {
      }
      public void findFinalDaySharePoints(int input1, int input2, int half) 
      {
          System.out.println(input2);
          if(input1%2 == 0) {
              for(int i = 1; i &lt;= input1 ; ++i)
              {
                  if(i&lt;half)
                  {
                      input2 = input2 + 50;
                      System.out.println(input2);
                  }
                  else if(i&gt;half)
                  {
                      input2 = input2 - 25;   
                      System.out.println(input2);
                  }
              }
          }
          else
          {
              for(int i = 1; i &lt;= input1 ; ++i)
              {
                  if(i&lt;=half)
                  {           
                      input2 = input2 + 50;
                      System.out.println(input2);
                  }
                  else if(i&gt;half)
                  {
                      input2 = input2 - 25;
                      System.out.println(input2);
                  }
              }
              System.out.println("The final share value is "+input2);
          }
      }
  }
  </code></pre>