Hello All,
I have made the below code but i want to add something extra to it. I have tried to do it several times already but the code just seems to stop working
What i need it to do is to keep asking the user to enter the CD Title and CD Cost repeatedly and to total all the CD Costs together.
<html>
<body>
<script language=‘JavaScript’> //set the language
a=(prompt(‘please enter the CD Title:’,0)); // enter the cd title promt
b=parseFloat(prompt(‘please enter the CD Cost:’,0)); // enter the cd cost promt
document.writeln(’ your CD Title is: <b>’ + a + ‘</b>’); //write the cd title to the screen in bold
document.writeln(’ your CD Cost is: <b>’ + b + ‘</b>’); //write the cd cost to the screen
</script>
</body>
</html>
E.g.
Customer wants to buy X CD’s.
The prompt will appear X times untill the customer has no more CD’s they want to buy
All the CD Titles & CD Costs should be written to the screen
With Total
End Product:
your CD Title is: RnB Classic Vol 1 your CD Cost is: 1.00
your CD Title is: RnB Classic Vol 2 your CD Cost is: 1.00
your CD Title is: RnB Classic Vol 3 your CD Cost is: 1.00
Total Cost 3.00
Can anyone help?