Home
ActionScript
Blog

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<script>
//Demonstrates program can find perimeter and area
//Catherine Casuat 09/27

var length = 0;
var width =0;

alert("We are going to find the area of a rectangle.");
var length=prompt("Give me the length of the rectangle.");
alert("The length is " + length);

var width=prompt("So, What is the width?");
alert("The width is " + width);

var total=0;
length = eval(length);
width = eval(width);

var total = length * width;

alert(length + " x " + width "="+ total);

var greetings;
greeting = "Now we're going to find the perimeter, ";
alert (greeting);

var numberOne=0;
var numberTwo=0;
var numberOne=prompt("Give me the height please.");
alert(numberOne);
var numberTwo=prompt("Give me the width, please.");
alert(numberTwo);
var total=0;
numberOne= eval(numberOne);
numerTwo=eval(numberTwo);
var total= numberOne + numberOne + numberTwo + numberTwo;
alert ("The perimiter is " + total + ". Yay!");
</script>