title: I need to ask user to input a value for the triangle and a character for it?
body: <p>I am almost done with the code i just need to figure out how to make the user input values for character and the height of the triangle using cout and cin thanks this is all my code hard coded.</p>
  
  <p>I feel like i worded it wrong basically the program is supposed to draw a triangle using the function drawline i created below, when i compile and run it asks me to enter a user choice if i enter 1 it runs the code in the if (userChoice == 1){} basically i want a cin and cout code structure that allows them to input their values for lineLength and displayChar. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;math.h&gt;
  
  using namespace std;
  
  void drawLine (int lineLength, char displayChar);
  void placePoint (int lineLength) ;
  
  int main()
  {
      int userChoice = 0;
      cout &lt;&lt; "**********************************" &lt;&lt; endl;
      cout &lt;&lt; "* 1 - DrawTriangle *" &lt;&lt; endl;
      cout &lt;&lt; "* 2 - Plot Sine graph *" &lt;&lt; endl;
      cout &lt;&lt; "* 3 - Exit *" &lt;&lt; endl;
      cout &lt;&lt; "Enter a selection, please: " &lt;&lt; endl;
      cin &gt;&gt; userChoice;
  
      int x,y,t =0;
      char displayChar = ' ';
      int lineLength = 0;
      double sinVal= 0.00;
      double rad = 0.00;
      int plotPoint = 0;
  
      if (userChoice == 1)
          for (int x=1; x &lt;= lineLength; x=x+1) {
              drawLine ( x, displayChar);
          }//end for
  
      for (int y=lineLength-1; y &gt;= 1; y=y-1) {
          drawLine ( y, displayChar );
      }//end for
  }//end main at this point.
  
  void drawLine (int lineLength, char displayChar) 
  {
      for (int x=1; x &lt;= lineLength; x=x+1) {
          cout &lt;&lt; displayChar;
      }
      cout &lt;&lt; endl;
  
      for (int y=y-1; y &gt;= 1; y=y-1) {
          cout &lt;&lt; displayChar;
      }
      cout &lt;&lt; endl;
  } //end drawline
  </code></pre>