title: C++ Looping and Declaring Functions
body: <p>Just started to learn C++ and i'm having an issue with getting a function to loop... not really sure if i'm even doing it right! Any help would be greatly appreciated.</p>
  
  <p>To give some context, i'm trying to build a simple degrees to farenheit converter which takes a user input for the value in degrees and outputs a value in farenheit. Also, like in python where you can use: <code>time.sleep()</code> to set a delay between messages, can you do that in C++?</p>
  
  <p>Here's what i've managed to do so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  //-------------------------------------------------
  
  void DegreesToFarenheit()
  {
       //Declaration
      float Degrees, Farenheit;
  
      //User Prompt
      cout &lt;&lt; "Please Enter a Temperature in Degrees: " &lt;&lt; endl;
      cin &gt;&gt; Degrees;
      cout &lt;&lt; "" &lt;&lt; endl;
      cout &lt;&lt; "" &lt;&lt; endl;
  
      //Program
      Farenheit = (((Degrees * 9)/5) + 32);
      cout &lt;&lt; Degrees &lt;&lt; " Degrees" &lt;&lt; " is " &lt;&lt; Farenheit &lt;&lt; " Farenheit";
      cout &lt;&lt; "" &lt;&lt; endl;
  
  }
  char RepeatPrompt()
  {
      char Ans;
      cout &lt;&lt; "Would you like to enter a new value? ";
      cin &gt;&gt; Ans;
      cout &lt;&lt; "" &lt;&lt; endl;
      if(Ans = "y" or "Y")
          {DegreesToFarenheit();}
      else if(Ans = "n" or "N")
          {return 0;}
      else
          {main();}
  }
  
  int main()
  {
      cout &lt;&lt; "Degrees To Farenheit Converter V1.0" &lt;&lt; endl;
      cout &lt;&lt; "----------------------------------------" &lt;&lt; endl;
      DegreesToFarenheit() ;
      RepeatPrompt() ;
      return 0;
  }
  </code></pre>