anonymous
2007-03-16 20:49:01 UTC
* Write a program for the music store: [Your name]'s Music Store created for the last assignment..
* Create an HTML file with all essential tags.
* Give your page the title JavaScript Assignment2
* In the body of the HTML display the table with the artist list (same as last time).Place the following text below the table:
** A discount of 15% on the displayed price for all items by Janis Joplin.
** A discount of 10% on the displayed price for the DVD, 15% for the CD and 20% for the Audio Cassette by Police.
** A discount of 20% on the displayed price for all items other than DVD by The Who.
* Write JavaScript to perform the tasks that follow. While some of the tasks remain the same, some new tasks have been introduced. READ CAREFULLY.
1. Using the alert() method, write the message "Welcome to [Your Name's] website" so that the message shows up everytime the page is loaded.
2. Using the confirm()method, ask the user "Would you like to place an order?". If the user clicks on OK, proceed with the next step. If the user clicks on Cancel take the user back to the homepage.
3. Using the prompt() method, ask the user to enter the artist's name, the number of DVDs, the number of CDs and the number of audio cassette's the user wishes to purchase. Save the answers in seperate variables. Also use a seperate prompt for each value.
4. Once the user has entered all information, use the confirm() method to display the values entered. Ask the user if she wishes to continue with the purchase. .
If the user clicks on OK, proceed to calculate the value of purchases and then display the final output (YOUR ORDER).
If the user clicks on Cancel, use another confirm() method to ask user the question "Do you wish to cancel order?".
If the user clicks on OK,take the user back to the homepage.
If the user clicks on cancel, display once more the values entered by the user and display the message "Your order shall be processes next week" using a single alert() method.
5. CALCULATING VALUE OF THE FINAL PURCHASE:
1. If the artist value is Janis Joplin,calculate the total value of puchases as shown: Final value = [ (no. of DVDs ordered * 10) + (no. of CDs ordered * 7) + (no. of audio cassettes ordered * 5) ] * 0.85
2. If the artist value is Police, calculate the total value of puchases as shown: Final value = [ (no. of DVDs ordered * 10) * 0.90 + (no. of CDs ordered * 7) * 0.85 + (no. of audio cassettes ordered * 5) * 0.80 ]
3. If the artist value is The Who,calculate the total value of puchases as shown: Final value = [ (no. of DVDs ordered * 10) + (no. of CDs ordered * 7) * 0.80 + (no. of audio cassettes ordered * 5) * 0.80) ]
4. For all other artist values, calculate the total value of purchases as shown: Final Value = (no. of DVDs ordered * 10) + (no. of CDs ordered * 7) + (no. of audio cassettes ordered * 5)
6. The output should look something like this:
YOUR ORDER
Artist name:
No. of DVDs:
No. Of CDs:
No. of Audio Cassettes:
Total value of your order:
7. For this program, make use of atleast one if-else statement, atleast one occurrence each of the AND and NOT operator and a relational operator (in the Boolean expression that tests for the conditional statements).