Well I'm back again after hitting another stumbling block.
This time I'm trying to input 4 values which the program will display before outputting as a total.
So far I have managed to get it to prompt for & display the values, but instead of giving a total it displays each individual value.
I'm close, but can't see the error.......any idea's ??
...................................................................
<HTML>
<HEAD>
<TITLE>Electric Bills
</TITLE>
<SCRIPT >
/* Program to read in a known number of data items and store them in an array */
var paymentArray = new Array (4);
var total;
document.write('Array program to display a customers four quarterly bills to an Electricity company & show the total due');
total = 0
for (var quarter = 0; quarter < paymentArray.length; quarter = quarter + 1)
{
paymentArray[quarter] = window.prompt('Enter payment value','')
};
document.write('<BR>' + '<BR>');
document.write('Confirmation of amounts payable' + '<BR>' + '<BR>');
for (var quarter = 0; quarter < paymentArray.length; quarter = quarter + 1)
{
document.write(paymentArray[quarter] + '<BR>')
total = total + paymentArray[quarter]
total = parseFloat(total)
}
document.write('total amount paid is ' + total + '<br>')
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
...............................................................................