Make your own free website on Tripod.com

~~~Chao Li~~~

~Kumo no Mukou, Yakusoku no Basho~

 
~~~~

<html>
<head>
<title>BadAdd</title>
</head>

<body>
<h1>The BadAdd</h1>
<script>
//Chao Li. September 20, 2007
//BadAdd
//demonstrates a potential pitfall

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

//get the cost of the meal from the user
meal = prompt("How such wat 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>
</body>
</html>

 
 
Chapter 2

Chapter3

Chapter4
Chapter5
Chapter 6
Other
 
~~~~