Menu

Lost please help

bruceleo
2007-10-02
2012-09-26
  • bruceleo

    bruceleo - 2007-10-02

    i have just started out learn c++ and have hit a wall can anyone help me please i am using dev-c++ to compile a samll tempreture conversion progam i am getting an error on a couple of line but i dont know what they are can some one let me know whats wrong with them

    //
    // Program to convert temperature from Celsius degree
    // units into Fahrenheit degree units:
    // Fahrenheit = Celsius * (212 - 32)/100 + 32
    //

    include <cstdio>

    include <cstdlib>

    include <iostream>

    using namespace std;
    int main(int nNumberofArgs, char* pszArgs[])
    {// enter the temperature in Celsius
    int celsius;
    cout << “Enter the temperature in Celsius:”; I AM GETTING THE ERROR ON THIS LINE
    cin >> celsius;
    // calculate conversion factor for Celsius
    // to Fahrenheit
    int factor;
    factor = 212 - 32;
    // use conversion factor to convert Celsius
    // into Fahrenheit values
    int fahrenheit;
    fahrenheit = factor * celsius/100 + 32;
    // output the results (followed by a NewLine)
    cout << “Fahrenheit value is:”; THIS LINE
    cout << fahrenheit << endl;
    // wait until user is ready before terminating program
    // to allow the user to see the program results
    system(“PAUSE”); AND THIS LINE
    return 0;
    }

     
    • Anonymous

      Anonymous - 2007-10-02

      That can happen if you use Microsoft Word as your code editor! ;-)

       
      • Wayne Keen

        Wayne Keen - 2007-10-02

        Clifford here taught me to look for that by the way.

        Wayne

         
    • Wayne Keen

      Wayne Keen - 2007-10-02

      You are using the wrong quotes - it should look like this "

      Wayne

       
    • Wayne Keen

      Wayne Keen - 2007-10-02

      See how this compiles:

      //
      // Program to convert temperature from Celsius degree
      // units into Fahrenheit degree units:
      // Fahrenheit = Celsius * (212 - 32)/100 + 32
      //

      include <cstdio>

      include <cstdlib>

      include <iostream>

      using namespace std;
      int main(int nNumberofArgs, char* pszArgs[])
      {// enter the temperature in Celsius
      int celsius;
      cout << "Enter the temperature in Celsius:";
      cin >> celsius;
      // calculate conversion factor for Celsius
      // to Fahrenheit
      int factor;
      factor = 212 - 32;
      // use conversion factor to convert Celsius
      // into Fahrenheit values
      int fahrenheit;
      fahrenheit = factor * celsius/100 + 32;
      // output the results (followed by a NewLine)
      cout << "Fahrenheit value is:";
      cout << fahrenheit << endl;
      // wait until user is ready before terminating program
      // to allow the user to see the program results
      system("PAUSE");
      return 0;
      }

       
    • bruceleo

      bruceleo - 2007-10-02

      THANK YOU VERY MUCH

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.