Make your own free website on Tripod.com
 
Home
ActionScript
Blog

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<script>
//BadAdd
//Demonstrates a potential pitfall
//Catherine Casuat, 09/19

var meal;
var tip = meal * .15;
var total = meal + tip;

//get the cost fo the meal from the user

meal = prompt("How much was the meal?");

var tip = meal * .15;
var total = meal + tip;

alert ("the meal is $" + meal);
alert ("the tip is $" + tip);
alert ("Total bill $" + total);
</script>