Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

If anyone has used Alice 2.4, I'm having trouble with variables and functions to create an algorithm of a person jumping from a burning building and calculating the height of their fall when they land on the ground. Help would be appreciated.

OpenStudy (e.mccormick):

If I recall, Alice makes Java code. Might be able to help if you can see the code.

OpenStudy (anonymous):

How would I go about doing that? @e.mccormick I'm sorry, I'm fairly new to programming in general, so I'm very uninformed on the subject.

OpenStudy (e.mccormick):

Hmmm. Well, I have only looked at Alice once... so not sure of all the specifics.

OpenStudy (anonymous):

Oh, well thank you for you help anyway.

OpenStudy (e.mccormick):

They have a slow download server for Alice....

OpenStudy (anonymous):

They do :( I'm really not a fan of Alice so far.

OpenStudy (e.mccormick):

OK, I am looking at the snowman tutorial one. It has some stuff for moving the eyes up and down. So the movement seems pretty simple. They have premade methods for most of that. Now, for the height of the fall, well, you need some sort of scale. See, if I fell off the tower I climbed today, I woulf have only fallen 9 feet because I was near the bottom. However, if someone filmed me and put that on a big screen TV, those 9 feet would look like 2 or 3 feet. On a computer screen, well, they would look like inches, not feet! The entire 9 feet would be just an inch or two on a phone screen. But how it looks does not change what it really is. So you need soe sort of scale to represent the real distance involved.

OpenStudy (e.mccormick):

Or do it all in pixels and tell people how many pixels they fell.

OpenStudy (anonymous):

Yeah, I know about the built-in methods. What I'm concerned with is creating a new variable in which I have to use the buildings functions and the person's functions to make the person to fall to the ground from the top of the building and say the height of the drop that the person fell from.

OpenStudy (anonymous):

I've never been taught how to do it in pixels.

OpenStudy (anonymous):

I'm sorry about such a tedious question.

OpenStudy (e.mccormick):

Well, on the Properties tab, I see "create a new variable" as a button. I clicked it. It wants a name, type, and initial value. So height as a number set to 0 to start should work.

OpenStudy (e.mccormick):

OK. Looks like you can then drag that variable to use it...

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!