# a little c++ help please

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

1. ### flynfrogCool isnt Cheap

Joined:
Jul 16, 2001
Messages:
6,657
37
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. ### druidWhat do the 5 fingers say?

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

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

3. ### flynfrogCool isnt Cheap

Joined:
Jul 16, 2001
Messages:
6,657
37
Location:
Utah
i still get a wind chill of 30 with a wind of 0 and a temp of 0

4. ### druidWhat do the 5 fingers say?

Joined:
May 13, 2001
Messages:
702
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...

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

6. ### BoypussYgame over.

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

7. ### Chimpa CodigoBаnned bу Ѕuреr Modulators

Joined:
Jan 27, 2001
Messages:
68,613
37
Location:
Salinas, CA
misinterpreted programming, there is no such thing as bad programming just bad programmers

8. ### flynfrogCool isnt Cheap

Joined:
Jul 16, 2001
Messages:
6,657
37
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

Joined:
Jan 27, 2001
Messages:
68,613
37
Location:
Salinas, CA

Joined:
Jul 16, 2001
Messages:
6,657
37
Location:
Utah

11. ### BoypussYgame over.

Joined:
Jun 27, 2000
Messages:
51,953
0
Location:
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.

12. ### RickNew Member

Joined:
Feb 20, 2002
Messages:
1,735
0
Location:
Henderson, NV
are you a CS major?

Joined:
Jun 27, 2000
Messages:
51,953
0
Location:
yes

14. ### flynfrogCool isnt Cheap

Joined:
Jul 16, 2001
Messages:
6,657
37
Location:
Utah
thats why im a EE
i understand circuts

15. ### BoypussYgame over.

Joined:
Jun 27, 2000
Messages:
51,953
0
Location:
thats good, we need different people in different fields...that way we can grow and support each other.

Joined:
Jul 16, 2001
Messages:
6,657