Alice Community  

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

Thread Tools Display Modes
MPG mathematical calculations and imputing data
Posts: n/a
Default MPG mathematical calculations and imputing data - 03-16-2012, 09:55 PM

I'm trying to do problem 1 from chapter 3.

It says: "Create a world in which the user is asked for the number of gallons of fuel his or her car can hold, and the number of miles that he or she can drive on a full tank. Use variables to hold these values. You should also have a variable to hold the car's miles-per-gallon (MPG). Calculate the MPG with the following forumla:


The world should have a person and a car. The initial setup the car should be positioned off-camera. After the data is entered, the person should approach the camera and the car should drive into view and stop in front of the camera. The person should then say a message indicating the car's MPG, as calculated from the data entered by the user. Then the car should drive away, to a position off camera. "

I don't know how to begin this problem. Is it possible for someone to walk me threw it? I have no idea how to make the character say the MPG.

Thank You
Reply With Quote
Senior Member
TauTrumpsPi's Avatar
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 03-17-2012, 08:35 AM

In the methods, there should be a "say" method.

Ask for input by using the "ask user for a number" function.

I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?

Wondering about my username?
Reply With Quote

Thread Tools
Display Modes

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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.