Learn Alice in FREE step-by-step lessons.
Unit II: Creating Code

In this lesson, you will use arithmetic operators to do some simple math.
In this chapter, you will learn how to perform simple mathematical calculations in Alice using arithmetic operators. You will also learn how to create and use a counter to keep track of how many times an action occurs and how to calculate a total by adding values as a program runs. These skills will help you use numbers and calculations to control and add functionality to your Alice programs.
Objectives:
- Use assign and math to assign a value.
- Create code to do math using just one step.
- Find a total, percent and other values.
- Use functions to get information about objects, such as getHeight.
Please study the material at each of the links below.
Cost of 3 Soccer Balls: How much does one soccer ball cost? Then 3 would cost total=cost * 3
Counters: Penguins count using counter=counter+1
The Witch is Older: What ever age you say you are, the witch says she's older.
The fish share the gold coins: Learn about division and remainders.
Integer Division Drill: Practice integer division.
Remainder Drill: Practice finding remainders.
Finding a Tip: The Mad Hatter calculates 15% tip.
Cost of 3 different items: Finds the total of 3 different values: total=total+cost
Monkey jumps for banana: Monkey jumps a bit higher each time by multiplying variable by 1.3
How far is the cave?: We use a function to find how far away something is.
How tall is the snow-woman?: We use a function to find height.
Move the bunny to look in the gopher hole: We use a function to find distance.
Calculate Distance to Move Skater: Distance to move to be next to something
Writing functions: Create a function to get distance to move next to something
Self-Study Questions: What have you learned?
Active Learning: Practice what you have learned
Discussion questions: What do you think?
Glossary for A Little Math
Full Glossary