Alice Community How do I have Alice Calculate a Math Problem
 User Name Remember Me? Password

 Thread Tools Display Modes
 How do I have Alice Calculate a Math Problem
rossim0
Guest

Status:
Posts: n/a
How do I have Alice Calculate a Math Problem - 01-30-2010, 12:41 PM

I have already done the animation to this project. I need the work to ask how many miles it may be to a place. Then, what is the speed limit. These i guess would be two separate variables. Then the person in the program divides the speed limit by the miles and comes up with a time it will take to get to the place. They cant be fixed numbers because it has to work for any random numbers. So in order...

Miles are asked for input by the user
Speed Limit is asked for input by the user
car drives up
person turns to car, and then away
Person then answers equation which is basically speed limit divided by miles

Just having an issue getting division equation into this program.

I have attached my file & would appreciate any help. I'm really bad with variables. Thanks a lot.
Attached Files
 Road to Hana.a2w (834.6 KB, 157 views)

 zonedabone Senior Member     Status: Offline Posts: 577 Join Date: Nov 2008 Location: In the interwebs 01-30-2010, 06:00 PM Ok! I'm here to help. First, you're going to want to make variables. Go into the world's properties, and select create variable. Type the name "Distance" into name, and select number as the type. Repeat this process, except name it "Speed" Next, drag the "Distance" variable into the event, end set it's value to anything. Go into the world's functions, and drag "Ask user for a string" into the number box. Click other, and type a question about the distance. Repeat this for the "Speed" variable. Third, drag the variable "Distance" set it's value to itself, found under expressions. click on this reference, and select math. Click "Distance/", and select time under expressions. Where you want it have the zombie say something. Under the world's functions, drag"What as a string" into the value. Drag distance into that. You're done! 'Apple Macintosh' - An anagram of 'Complaints Heap' M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs. You're *such* a mac person.
 A few issues with your reply
rossim0
Guest

Status:
Posts: n/a
A few issues with your reply - 01-30-2010, 10:50 PM

I really appreciate you taking the time to help me out, but I am having some issues, I have uploaded what i have done so far following your guidelines.

1. When I create the distance variable and add it into my "world.my first method" as the first method, I am not able to put ask user for a string int he number section, it doesn't accept it. If you check out my program I uploaded you will see what I have done to try and make it work.

2. Also, it seems that we are missing a A Time variable. Miles / Speed limit = Time. I don't know how to finish the program. I have got it so I input the numbers for speed and miles, how do I input the zombie saying the answer for the equation. Please if you have some time, checkout my program I made and let me know what I'm doing wrong. Thanks a lot. Cant tell you how much i appreciate your help.
Attached Files
 Road to Hana.a2w (837.5 KB, 289 views)

 zonedabone Senior Member     Status: Offline Posts: 577 Join Date: Nov 2008 Location: In the interwebs 01-31-2010, 05:17 PM Oh! I'm so sorry! I accidently typed the wrong thing. I meant to say "Ask user for a number." Sorry! I see that you successfully added the time variable. Drag this so that it's after the first two questions. Right click on "World.distance" within your time function, and then click on math. Click distance/, click expressions, and then speed. The variable will now be set as distance/speed. The say bubble will be very advanced, but for now, simply have the zombie say something where you want him to. Next, drag "What as a string" from the world's functions into his text to say. Go to expressions, and select time. Hope this helps! 'Apple Macintosh' - An anagram of 'Complaints Heap' M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs. You're *such* a mac person.
 How?
 Deathlaser Junior Member   Status: Offline Posts: 2 Join Date: May 2012 How? - 05-06-2012, 12:29 PM How do I get alice to calculate simple math problems like 4+5 Like the user types in "4" and "+" and "5" Hurry, I only have till tuesday. Last edited by Deathlaser; 05-06-2012 at 12:33 PM. Reason: fix up

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge

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

 Contact Us - Alice.org - Archive - Top