Originally Posted by 511475
this program is supposed to give the user the ability to enter numbers
in cents and tell you how many dollars you have. Please anybody can
tell me what's wrong. been working on it two weeks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html>
<head>
<title>Cents to Dollars</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function calcCents (){
var cents = document.money. cents.value;
var dollars = 0;
var dollars = cents / 100;
var change = cents % 100;
if (change != 00)
window.alert("T he number of cents you entered is equal to $" +
dollars + ".00");
else
window.alert("T he number of cents you entered is equal to $" +
dollars);
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="money" action="">
<p>Cents: <input type="text" name="cents" /><br />
<input type="button" value="Cents to Dollars" onclick="calcCe nts();"
/></p>
</form>
</body>
</html>
this program is supposed to give the user the ability to enter numbers
in cents and tell you how many dollars you have. Please anybody can
tell me what's wrong. been working on it two weeks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html>
<head>
<title>Cents to Dollars</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function calcCents (){
var cents = document.money. cents.value;
var dollars = 0;
var dollars = cents / 100;
var change = cents % 100;
if (change != 00)
window.alert("T he number of cents you entered is equal to $" +
dollars + ".00");
else
window.alert("T he number of cents you entered is equal to $" +
dollars);
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="money" action="">
<p>Cents: <input type="text" name="cents" /><br />
<input type="button" value="Cents to Dollars" onclick="calcCe nts();"
/></p>
</form>
</body>
</html>
Comment