Algorithm for JS 2

Algorithm for JS 2 - 8. If user input sub, user will...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1. Start 2. Input: what is the name of the product? - > var productname 3. Input: how much is it? – >var price 4. Input: how many do you want? –> var quantity 5. Decision:Confirm with the user if this is the right product and amount? 6. If user input pizza, user will receive 10% discount cost = (quantity*price of pizza) – {.10* price of pizza*quantity} and go to step 11 7. If user input water, user will receive 10% discount cost = (quantity*price of water) – {.10* price of water*quantity} and go to step 11
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 8. If user input sub, user will receive 10% discount cost = (quantity*price of sub) {.10* price of sub*quantity} and go to step 11 9. If user input hotdogs, user will receive 10% discount cost = (quantity*price of hotdogs) {.10* price of hotdogs*quantity} and go to step 11 10. If the order is not ok, display you have entered an invalid product, refresh the page to re order 11. If the order is ok, display the cost 12. End NO YES YES NO YES NO YES NO YES...
View Full Document

This note was uploaded on 12/28/2011 for the course 198 170 taught by Professor Kristianstout during the Spring '10 term at Rutgers.

Page1 / 2

Algorithm for JS 2 - 8. If user input sub, user will...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online