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

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<html>
<head>
<title>GoodAdd</title>
</head>

<body>
<h1>The GoodAdd</h1>
<script>
//GoodAdd
//Demonstrates eval function
//Catherine Casuat, 09/19

var meal;

//get the cost of the meal from the user meal = prompt ("How much was the meal?");

//convert the value to a number meal = eval(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>