a little c++ help please

Discussion in 'OT Technology' started by flynfrog, Feb 7, 2003.

  1. flynfrog

    flynfrog Cool isnt Cheap

    Joined:
    Jul 16, 2001
    Messages:
    6,621
    Likes Received:
    6
    Location:
    Utah
    Wind Chill (°F) = 35.74 + 0.6215T – 35.75(V^0.16) + 0.4275T(V^0.16)Where, T = Air Temperature (°F) V = Wind Speed (mph)

    why doesnt this work in my program i have it entered as this

    windchill = 35.74 + (.6215 * temp) - (35.75 * (windspeed , .16)) + (.4275 * temp) * (windspeed , .16);



    the full code is

    Code:
     //RYAN ELLIS
    //rellis
    //Mike
    //E2
    //windchill
    //this programs takes a temp input and a wind speed
    //and converts it to the windchill factor
    
    #include <iostream.h>
    
    
    void main (void)
    
    {
    float windspeed,  //speed of wind
          temp,       //outside temp
          windchill;   //windchill factor
    
    cout << "Welcome to the windchill calulator;\n";
    cout << "Enter the wind speed in MPH";
    cin >> windspeed;
    cout << "Enter the temp in degrees Fahrenheit";
    cin >> temp;
    
    //calculate
    
    windchill = 35.74 + (.6215 * temp) - (35.75 * (windspeed , .16)) + (.4275 * temp) * (windspeed , .16);
    
    
    //output the results
    
    cout << "The windchill is\n";
    cout << windchill;
    } 

    or is my wind chill equastion wrong
     
  2. druid

    druid What do the 5 fingers say?

    Joined:
    May 13, 2001
    Messages:
    702
    Likes Received:
    0
    try changing the equation to:

    windchill = (35.74 + (.6215 * temp)) - ((35.75 * (windspeed , .16)) + ((.4275 * temp) * (windspeed , .16)));
     
  3. flynfrog

    flynfrog Cool isnt Cheap

    Joined:
    Jul 16, 2001
    Messages:
    6,621
    Likes Received:
    6
    Location:
    Utah
    i still get a wind chill of 30 with a wind of 0 and a temp of 0
     
  4. druid

    druid What do the 5 fingers say?

    Joined:
    May 13, 2001
    Messages:
    702
    Likes Received:
    0
    Are you sure thats the right equation, forget the programing part just work out the equation and it doesnt seem right. If you enter 0 and 0 you end up with 35.74 which doesnt seem right. Maybe im wrong though but i would do a search on wind chill and see if that is the right equation to find it.
     
  5. Nocera

    Nocera ...

    Joined:
    Aug 9, 2000
    Messages:
    1,307
    Likes Received:
    0
    Location:
    Long Island, NY
    When you raise something to a power you need to do pow(num, power) and include math.h
     
  6. BoypussY

    BoypussY game over.

    Joined:
    Jun 27, 2000
    Messages:
    51,953
    Likes Received:
    0
    Location:
    IN YOUR HEAD
    exactly, pow(num, power) is the way to do it...don't forget about #include <math.h>
     
  7. Chimpa Codigo

    Chimpa Codigo Bаnned bу Ѕuреr Modulators

    Joined:
    Jan 27, 2001
    Messages:
    68,463
    Likes Received:
    21
    Location:
    Salinas, CA
    misinterpreted programming, there is no such thing as bad programming just bad programmers
     
  8. flynfrog

    flynfrog Cool isnt Cheap

    Joined:
    Jul 16, 2001
    Messages:
    6,621
    Likes Received:
    6
    Location:
    Utah
    i forgot the power my freind is a ta for the class she helped me

    i hate prgraming this is the last programing class i will take ever
     
  9. Chimpa Codigo

    Chimpa Codigo Bаnned bу Ѕuреr Modulators

    Joined:
    Jan 27, 2001
    Messages:
    68,463
    Likes Received:
    21
    Location:
    Salinas, CA
  10. flynfrog

    flynfrog Cool isnt Cheap

    Joined:
    Jul 16, 2001
    Messages:
    6,621
    Likes Received:
    6
    Location:
    Utah
    what so bad about it i cant make it any simpler
     
  11. BoypussY

    BoypussY game over.

    Joined:
    Jun 27, 2000
    Messages:
    51,953
    Likes Received:
    0
    Location:
    IN YOUR HEAD
    damn if you can't handle baby C++ that you are making a right decision. i wish i could do those kind of programs right now instead of the 10 page of code i have to submit for my advanced c++ class.:mad:
     
  12. Rick

    Rick New Member

    Joined:
    Feb 20, 2002
    Messages:
    1,735
    Likes Received:
    0
    Location:
    Henderson, NV
    are you a CS major?
     
  13. BoypussY

    BoypussY game over.

    Joined:
    Jun 27, 2000
    Messages:
    51,953
    Likes Received:
    0
    Location:
    IN YOUR HEAD
  14. flynfrog

    flynfrog Cool isnt Cheap

    Joined:
    Jul 16, 2001
    Messages:
    6,621
    Likes Received:
    6
    Location:
    Utah
    thats why im a EE
    i understand circuts
     
  15. BoypussY

    BoypussY game over.

    Joined:
    Jun 27, 2000
    Messages:
    51,953
    Likes Received:
    0
    Location:
    IN YOUR HEAD
    thats good, we need different people in different fields...that way we can grow and support each other.:bigthumb:
     
  16. flynfrog

    flynfrog Cool isnt Cheap

    Joined:
    Jul 16, 2001
    Messages:
    6,621
    Likes Received:
    6
    Location:
    Utah
    i build it you make it work
     

Share This Page