Question:
i dont know how to do this JAVASCRIPT assignment! please help or ill die!!!?
anonymous
2007-03-16 20:49:01 UTC
here are the instructions...

* 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).
Three answers:
anonymous
2007-03-16 21:13:00 UTC
This is a horrible assignment. Not only is it a more difficult way to go about making a website like this, but if I ever came to a website like this I would leave immediately.



Ok. Hopefully you can do the HTML stuff, so I won't touch that.

What you're going to have to do is put

somewhere in your page.

Between the scripts is going to go your code.



At the beginning you should do the alert. Alert works like this:



alert("Your message goes here");



And that will alert the message.



Then you'll do your confirm. You're going to have to do something like this:



var a = confirm("Click ok or cancel");



What that will do is make a variable called a. If the user click ok, a will be equal to 1. If the user clicks cancel a will be equal to 0.



So you're going to have to use an if statement next. It pretty much says if this, then do this.



if (a == 0) {

window.location = "otherpage.html";

}

else {

// other stuff happens here

}



What this does is it checks if a is 0 or not (you need two equals signs). If it is than it takes the user to "otherpage.html". If not than it goes to where the else is and does what's in there.



Then finally you need to know about the prompts. They work like this.



var message = prompt("Type something in here");



And what this will do is make a variable named "message" and then set it equal to what the user types in the box that pops up.



For the AND and NOT and the relational things, it will work like this:



if (a = 0 && b = 0) {

// This will do stuff if a and b are 0. (this is and)

}



if (a > b) {

// This will do stuff if either a and b is 0. (this is the relation operator)

}



I'm not quite sure about the NOT operator. I'm sort of a hobbyist and have never needed to use any NOT operator.



Hopefully this includes all you know. You're going to have to think a little to get this to work.



Next time PAY ATTENTION IN CLASS!
anonymous
2016-03-17 01:48:44 UTC
They are right that you will die, but you will just have to wait longer to do it than those who eat unhealthy. Seriously meat has been linked to increasing your risk of cancer. Countries where they don't eat red meat also don't even have colon cancer. Diseases like crohn's and ulcerative colitis are diseases of the modern world where we have these horrible diets of processed foods. Underdeveloped countries where they basically just eat what they grow don't have those ailments. I have recently been working on cutting out meat and other processed foods because of health issues and I've been feeling more normal than I did for the last several years. I don't know what the problem would be as long as you pay attention to get enough of each nutrient, but you have to do that if you eat meat to. It's not like meat is some wonder food that gives everything you need. There are plenty of plants and such that provide tons of protein, and too much protein is a health problem anyway. I actually feel more energetic after a fruit and vegetable rich meal than a traditional one.
lollol
2007-03-16 20:52:39 UTC
Your questions is really too long but here maybe that can help



http://www.dynamicdrive.com/


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...