Hello,
My name is praveen and I am new to scratch programming.
I am looking for help on temperature conversion.
K= 5/9 (F-32) + 273
User will input F value and I have to convert to kelvin. I tried with
Operators but operators accept only integer values.
Not sure how can I use F value in the operator variable
Please help me out.
Many Thanks,
Praveen
Email: [email removed by moderator - please don't share contact information]
Last edited by Paddle2See (2011-09-19 07:46:00)
Offline
Hmmm.... Here's what I think you can do (I assume you want Fahrenheit, correct?):
Ask ['Enter the amount of Fahrenheit to convert'] Found in the 'Sensing' Category
Set [F] to [(answer)] The 'Set' block is found in 'Variables', and the '(answer)' block in sensing
Set [calc1] to [5/9]
Set [calc2] to [(F)-32]
set [calc3] to [(calc1*calc2)
set [calc4] to [(calc3)+273]
That should be the code!
If you want, I can upload an image of what it should look like!
Offline
Thank you very much...
Another question...
For example: For Men who is 6 feet tall has to weigh minimum of 100 pounds... Every inch after 6 feet will have increase of 7 pounds... So the increase in height is directly propotional to increase in weight
I kind of understand the logic but I dont how to code in scratch
Logic from my understanding...
1. I have to get the Feet from user
2. I have to get the inch from user
3. For example if the user input 6 feet and 2 inch then I have to display the weight as
100 + 7 + 7 = 124
Please help me out...
Many Thanks,
Praveen
Offline
Hmm... So you want it to be
per 6 feet is 100 pounds, right?
every inch after 6 feet will increase it by 7 pounds. hmm, first you'd have to convert feet to inches, to make it simple.
Therefore:
Per 72 inches, is 100 pounds
Once we have got that, we need to work out the difference in inches to work out pounds.
so what you can do is (PS, this is just an example):
Ask ['How tall are you?'] Set [Tallness] to [(answer)*12] Set [difCalc] to [(Tallness)-100] set [fincalc] to [(difCalc)*7]
I believe this is what you asked for?
Offline
It depends, what do you need these squares for?
Offline
praway wrote:
Hello my name is Praveen, I need some help : How to draw six squares in a single line in scratch.... Each squares should have some space between each other .
Thanks,
Praveen.
Please post a new topic to get more responses.
Offline