title: Conversion Fahrenheit to Celsius using class c
body: <p>Hello everyone I'm having a problem. I'm fairly new and been stuck trying to solve it. </p>
  
  <p>When I run it the first part where it prints 0 for the Fahrenheit to Celsius is correct but once I input a number it just prints the number I input. I know it probably a simple answer but thank you for your time.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class Temp
  {
      public:
  
          Temp(); //CONSTRUCTOR: Sets private variable for Fahrenheit to 32
  
          void InputF(float F); //Initialize Fahrenheit temperature to F
  
          void Celsius(); //PRINTS the Celsius temperature corresponding to
  
          // the private Fahrenheit equivalent temperature
  
          void ChangeBy(float D); //Changes the private Fahrenheit temperature
  
          // by D degrees. 
  
          float Fahrenheit(); // returns the value of the private Fahrenheit temp
  
      private:
  
          float Fah; //Fahrenheit Temperature
  };
  
  int main() {
      float FF;
  
      Temp T; // Temperature Object
  
      T.Celsius(); 
  
      cout &lt;&lt; endl; //Note that the value will be 0 since the private variable is 32. 
  
      cout &lt;&lt; "Input a Fahrenheit temp: ";
  
      cin &gt;&gt; FF;
  
      T.InputF(FF);
  
      cout &lt;&lt; T.Fahrenheit() &lt;&lt; endl;;
  
      T.ChangeBy(34);
  
      cout &lt;&lt; T.Fahrenheit() &lt;&lt; endl;
  
      system("Pause");
  
      return 0;
  
  }
  
  Temp::Temp() {
      Fah = 32;
  }
  
  void Temp::InputF(float F) {
      Fah = F;
  }
  
  void Temp::Celsius() {
      cout &lt;&lt; Fah;
  }
  
  void Temp::ChangeBy(float D) {
      Fah = (5.0 / 9) * (Fah - 32);
  }
  
  float Temp::Fahrenheit() {
      return Fah;
  }
  </code></pre>