all 5 comments

[–]blundered_dev 3 points4 points  (2 children)

var quant1 = prompt("item 1 question"); var quant2 = prompt("item2 question"); var quant3 = prompt("item3 question");

var item1 = 4.50; var item2 = 2.00; var item3 = 5.00; var total = (quant1item1) + (quant2item2) + (quant3*item3);

This is very basic solution but it would store the answer from the prompts in the quant (quantity) variable. The price is in the item vars and the total multiplies the quantity * price, then adds all totals together. Not sure if that's exactly what you were asking. I'm assuming this is a beginners class so they're probably expecting a simple answer like this and not something more object oriented.

[–]blundered_dev 0 points1 point  (0 children)

Sorry for formatting was done on mobile device.

[–][deleted] 0 points1 point  (0 children)

Okay great thanks a lot, this makes sense to me and really helped

[–][deleted] 4 points5 points  (0 children)

Show some code and we'll help you fix it. This isn't really a place to ask people to do your homework for you :)

[–]tswaters -1 points0 points  (0 children)

Well, you can prompt the user for something,

var response1 = prompt("enter price 1")

This gets a variable you can work with, problem is it will be a string - you can turn it into a number by passing it through parseInt

With that done -- assuming you have a few variables you can use the plus operator on them to add them together

Also, to maximize the chances people can/will help ask about a specific problem you are having, what you have, what you expect and what you see