This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-09-19 06:58:06

praway
New Scratcher
Registered: 2011-09-19
Posts: 4

Temperature calculation

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

 

#2 2011-09-19 07:10:34

wulfmaster
Scratcher
Registered: 2011-04-23
Posts: 500+

Re: Temperature calculation

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!  smile
If you want, I can upload an image of what it should look like!


Social Connections - Bringing communities close together! http://cyberkidscountry.com/ip.php

Offline

 

#3 2011-09-19 08:18:37

praway
New Scratcher
Registered: 2011-09-19
Posts: 4

Re: Temperature calculation

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

 

#4 2011-09-19 08:32:48

wulfmaster
Scratcher
Registered: 2011-04-23
Posts: 500+

Re: Temperature calculation

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):

Code:

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?


Social Connections - Bringing communities close together! http://cyberkidscountry.com/ip.php

Offline

 

#5 2011-09-19 10:06:00

praway
New Scratcher
Registered: 2011-09-19
Posts: 4

Re: Temperature calculation

Thank you very much... Appreciate your help

Offline

 

#6 2011-09-19 13:20:42

praway
New Scratcher
Registered: 2011-09-19
Posts: 4

Re: Temperature calculation

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.

Offline

 

#7 2011-09-20 04:42:50

wulfmaster
Scratcher
Registered: 2011-04-23
Posts: 500+

Re: Temperature calculation

It depends, what do you need these squares for?


Social Connections - Bringing communities close together! http://cyberkidscountry.com/ip.php

Offline

 

#8 2011-09-20 18:21:07

laptop97
Scratcher
Registered: 2011-06-27
Posts: 1000+

Re: Temperature calculation

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.  smile

Offline

 

Board footer