/*Michael R. Clarke
  ClarkeJavaScript.js
  Cittone COmputer Programming
  10/26/02*/
/*********************************************/
function max(num1, num2)
{
//alert("num1 = " + num1 + ", num2 = " + num2);
if(num1 > num2)
return num1;
else if(num2 >= num1)
return num2;
}
/*********************************************/
function min(num1, num2)
{
//alert("num1 = " + num1 + ", num2 = " + num2);
if(num1 < num2)
return num1;
else if(num2 <= num1)
return num2;
}
/*********************************************/
function roundNumber(num)
{
//alert("num = " + num);
var rounder = 0;
var place = 0;
place = parseInt(prompt("To how many places would you want to round you number? (0/5)",""));
//alert("place = " + place + " rounder = " + rounder);
switch(place)
{
case 0:
rounder = 1;
break;
case 1:
rounder = 10;
break;
case 2:
rounder = 100;
break;
case 3:
rounder = 1000;
break;
case 4:
rounder = 10000;
break;
case 5:
rounder = 100000;
break;
}
num = num * rounder;
//alert("num = " + num);
num = Math.round(num);
//alert("num = " + num);
num = num / rounder;
//alert("num = " + num);
return num;
}
/*********************************************/
function readArray(arraySize)
{
var arrayName = new Array(arraySize);
for(var i=0;i<arrayName.length;i++)
  {
  arrayName[i] = parseInt(prompt("Enter Data for UserID #" + i + ":",""));
  }
return arrayName;
}
/*********************************************/
function printArray(arrayName)
{
for(var i=0;i<arrayName.length;i++)
  {
  document.write("Data for UserID #" + i + " is $" + arrayName[i] + "<BR>");
  }
}
/*********************************************/
function sumArray(arrayName)
{
var sum = 0;
for(var i=0;i<arrayName.length;i++)
  {
  sum = sum + arrayName[i];
  }
document.write("Total Data is $" + sum + "<BR>");
}
/*********************************************/
function Randomer(Size)
{
var RanNum = Math.round(Math.random() * Size);
return RanNum;
}
/*********************************************/
/*********************************************/

