I need help with this project I'm a week over due and am having problems with the following problem. Can some one please show me how to code this?

Write a program that prints a nicely formatted table of wind chill values. Rows should represent wind speed from 0 to 50 in 5 mph increments, and the columns represent temperatures from -20 to +60 in 10 degree increments.
The National Weather Service computes the wind chill index using the following formula:

35.74 + 0.6215T – 35.75(V0.16) + 0.4275T(V0.16)

where T is the temperature in degrees Fahrenheit, and V is the wind speed in miles per hour.
Create a function windChill(temperature, velocity) which will calculate and return the wind chill for a combination of temperature and wind speed. If the velocity (wind speed) is less than 3 miles per hour, the function should return the provided temperature. If the velocity is greater than or equal to 3 MPH use the formula to calculate and return the wind chill.

Your main() function should use nested loops to create the table, with repeated calls to your windChill() function to determine the value for each wind/temperature combination.
Evaluation:

Use of function to calculate wind chill
Use of nested loops (for or while) to print the rows
Format of table is important
numbers are integers and column aligned
header aligns with values

ava678 commented: welcome! +0

Recommended Answers

All 3 Replies

What part are you having trouble with? By the way, the formula, in Python terms is

35.74 + 0.6215 * t - 35.75 * v ** 0.16 + 0.4275 * t * v ** 0.16    
commented: I'm having trouble with the windChill function and the def Main() +0

Do you know how to code a function? All that's missing is to add an if/else block and a couple of keywords to what I already posted. As for a function main(), I don't see any reason to format the mainline code as a function at all, unless that is a requirement of the assignment. Often the mainline code is done like

if __name__ == '__main__':
    .
    .
    .

There is a very good reason for doing this which I can explain if you are interested.

I suggest if you have anything to add you do it in the form of a new post in this thread. If you just add a comment the thread list does not show that anything new has been added. Thus, unless I go back for a second look I will assume there is nothing new to see.

Hello!.. Nice to meet you...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.