hi there, ca you help me please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sala
    New Member
    • Nov 2006
    • 12

    hi there, ca you help me please

    I am supposed to write a program to take a depth (in kilometers) inside the earth as input data; compute and display the temperature at this depth in degree Celsius and degree Fahrenheit. The relevant formula are
    - Celcius = 10 (depth) + 20 (Celsius temperature at depth in Km)
    - Fahrenheit = 1.8 (Celsius) + 32
    Include two functions in your programs. Function CelsiusAtDepth should compute and return the Celsius temperature at a depth measured in Km. Function Fahrenheit should convert a Celsius temperature to Fahrenheit
  • seeminsuleri
    New Member
    • Nov 2006
    • 9

    #2
    hey there,
    following is the C++ code for it. but there is one ambiguity in it. you have written the formula for calculating the Celcius as under:
    Celcius = 10 (depth) + 20 (Celsius temperature at depth in Km)
    But i dont get where will this "Celcius Tempertaure at Depth" Come from?
    will u take it from the user as well?because i think ur program is only taking depth as an input from the user!

    just clear this and i will complete the CelciusAtDepth Function for u. For now here goes ur remaining code!

    #include<stdio. h>
    #include<math.h >
    #include<conio. h>
    using namespace std;

    float CelciusAtDepth( float);
    float Fahrenheit(floa t);
    void main()
    {
    float depth,Celcius,F ahren;
    cout<<"Enter the depth"<<endl;
    cin>>depth;
    Celcius=Celcius AtDepth(depth);
    cout<<"The Temperature in Celcius is "<<Celcius<<end l;
    Fahren=Fahrenhe it(Celcius);
    cout<<"The Temperature in Fahrenheit is "<<Fahren<<endl ;
    return 0;
    }

    float CelciusAtDepth( float Cel)
    {
    // To be completed...
    }

    float Fahrenheit(floa t C)
    {

    float x;
    x=1.8*C;
    x=x+32;
    return x;

    }


    Originally posted by sala
    I am supposed to write a program to take a depth (in kilometers) inside the earth as input data; compute and display the temperature at this depth in degree Celsius and degree Fahrenheit. The relevant formula are
    - Celcius = 10 (depth) + 20 (Celsius temperature at depth in Km)
    - Fahrenheit = 1.8 (Celsius) + 32
    Include two functions in your programs. Function CelsiusAtDepth should compute and return the Celsius temperature at a depth measured in Km. Function Fahrenheit should convert a Celsius temperature to Fahrenheit

    Comment

    Working...