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

#1 2011-12-21 03:42:17

Noak
New Scratcher
Registered: 2011-12-21
Posts: 2

Help!!

Hi

we need help getting our program produce a comma!! We need to do the Heron formula on scratch!!! Maybe someone can help us doing it or show us how we can get a comma in the equation.

Thanks  smile
Noak

Offline

 

#2 2011-12-21 03:49:42

Fordark
Scratcher
Registered: 2010-08-02
Posts: 100+

Re: Help!!

Show and tell is to advertise your projects. This goes in All About Scratch.
At the question, where in Heron's formula would you need to place a comma?


http://dl.dropbox.com/u/34855482/Fordarksig.png

Offline

 

#3 2011-12-21 05:03:40

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Help!!

Hi Noak,

Can you give us a link to your project so we can see what you have so far?  I'm not familiar with the Heron formula so a bit more detail would also be helpful.  The more detail you can give us, the better our chances of giving you what you are looking for  smile

Ah, I see from Wikipedia that Heron's formula is a way of calculating the area of a triangle from the length of it's three sides.  Maybe you are looking for a way to enter the three side lengths all at once, separated by commas?  If that's the case, you might want to try an easier approach as Scratch doesn't have an easy way to split answers apart on commas (although it can be done, see my Flexible Line project).  An easier approach would be to use the Ask/Answer blocks three times to set some variable values:

Ask "Enter length of side A" and wait
Set Side_A to Answer
Ask "Enter length of side B" and wait
Set Side_B to Answer
Ask "Enter length of side C" and wait
Set Side_C to Answer


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2011-12-21 05:08:13

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Help!!

http://upload.wikimedia.org/wikipedia/en/math/f/0/c/f0cf3670e5c3fc6a722ace65351826ef.png

Ah, I researched it, Heron's formula is a method of working out the area T of a triangle whose sides have lengths a, b, and c.

s is apparently the semiperimeter which can be worked out using this:

http://upload.wikimedia.org/wikipedia/en/math/e/c/5/ec50234ccbbd096784304c4048bc55a7.png

But I have no idea how the comma relates to this.

Last edited by rookwood101 (2011-12-21 05:09:04)


http://i.imgur.com/zeIZW.png

Offline

 

#5 2011-12-21 11:40:50

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Help!!

Perhaps he wants to output the answer with a comma?


Hai.

Offline

 

Board footer