Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Display a number to the user??
Old
zlloyd1
Junior Member
 
zlloyd1's Avatar
 
Status: Offline
Posts: 8
Join Date: Nov 2011
Location: Virginia
Question Display a number to the user?? - 11-05-2011, 01:03 PM

I am doing a project for my class and I am stumped here. I know how to get the math functions to properly calculate something, but I cannot figure out how to display the results. I am supposed to get the user to input two numbers, one for distance and one for speed limit, and divide speed limit into distance to get travel time, and then display the travel time on the screen. I have the distance and the speed limit and the calculation seems to be working, but I am not sure how to display the resulting travel time to the screen to check.

I have added the Alice file I am working on here for viewing, PLEASE tell me what I have to do to display the results!!!!
Attached Files
File Type: a2w testing.a2w (296.5 KB, 6 views)
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 11-05-2011, 01:23 PM

you forgot one little thing, the part where you had have alice say "default string" you need to place "what as string" there so you can place the time variable into that area, which that is found in the world>functions. I updated your version so here it is and check to see if thats what you want
Attached Files
File Type: a2w testing.a2w (297.1 KB, 24 views)


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
This does not return a calculated value??
Old
zlloyd1
Junior Member
 
zlloyd1's Avatar
 
Status: Offline
Posts: 8
Join Date: Nov 2011
Location: Virginia
Question This does not return a calculated value?? - 11-05-2011, 09:56 PM

I tried the changes you made and it does return a number, but the only number it will return is 1.0, no matter what distance and speed you enter.
I need it to divide the distance entered by the speed limit and return the time it will take....
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 11-06-2011, 01:23 AM

I looked at the world again and found that you have two sets of number variables of the exact same thing (speed,time,distance,blahblahblah) well when making your method, you accidentally used the different variables throughtout your code, so just try to use all the right variables and then you should have it corrected


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Thanks a million yo!!
Old
zlloyd1
Junior Member
 
zlloyd1's Avatar
 
Status: Offline
Posts: 8
Join Date: Nov 2011
Location: Virginia
Thumbs up Thanks a million yo!! - 11-06-2011, 01:00 AM

Thanks sfunk,
That was my ignorant mistake and it works now!!!!
YOU ARE A LIFESAVER
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 11-06-2011, 02:15 AM

No problem, glad to help out


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Reply

Tags
display, math, string


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.