{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Algorithm for JS 2

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

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

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

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

View Full Document
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern