We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey guys I am completely new to programming and I have been running into some issues so I finally decided to come here for help! So, I have an assignment where I simply need to calculate Wind Chill with the formula and add in variables of whatever number I choose which are T=Temperature and V= Wind Velocity in mph I am not sure exactly how to have processing carry out my formula and actually give me the exact calculation of what it needs to be! I have tried using String but it does not seem to carry out the work i expected! If I could get someone to assist me I would be very grateful! :)
Answers
oh and here is what I have so far!
[mod edit: code formatted]
http://forum.Processing.org/two/discussion/8045/how-to-format-code-and-text
Thanks GoToLoop, I was not sure why it was coming out in such a jumbled mess..
String datatype is for displaying & manipulating texts, not for Math:
That is, unless you wanna rely on some script language in order to eval() them as programming statements:
But I strongly advise you to use instead regular primitive number types like
int
&float
:First of all, Mathematical operation can be used only with int or float. It cannot be used with the strings.
If you use plus operator to add two string, it will just concatenate your strings.
Example -
Your corrected code.
Thank you guys, I wasn't expecting anyone to help this much honestly I appreciate the critique from both of you guys! I'm still very new to this and need a lot more practice of understanding how everything works!
Nice this is a life saver but I just need "T" & "V" not W but when I take the W out it seems to work fine.=) Awesome that helps me convert windchill to code. Blyk I have the same question on my page if you would like to put that same answer in my question to help the viewers on my question to know the answer as well. Thanks a lot man!