<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Example 3-5</title>
<script type="text/javascript">
	var eq = "5+4-3*2";//variable "eq" is going to be the evaluation of "5+4-3*2"
	var ans = eval(eq);//variable "ans", is eqal to the evaluation of the "eq"variable.  So the variable "ans" is = to 3
	var x = ans%2;//new variable, x is equal to the ans variable modulo 2. The variable x is 1
	switch(x)//switch tells javascript to put the variable x and plug it into the next three questions to compare and find the answer. (I know what I mean but dont know if I explained it good enough)sooooooo
	{
		case 2://if the variable is now 2
			alert(2);//alert the number two and....
			break;//brea from program
		case 1://if the variable is now 1
			alert(1);//alert 1 and continue to default and....
		default:
			alert(0);//alert 0 then....
			break;//break from program.
	}
</script>
</head>
<body>
</body>
</html>

