Results 1 to 4 of 4
Mar 19, 2012, 15:20 #1
- Join Date
- Mar 2012
- 0 Post(s)
- 0 Thread(s)
Is a loop needed? I have NO idea !
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.
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
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
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?