{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Algorithm for JS 3

Algorithm for JS 3 - Refresh the page to reload and place...

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

View Full Document Right Arrow Icon
Michael Mai JavaScript Assignment 3 1. START 2. INPUT: What is your name? – stored in var Name 3. INPUT: what product/service customer wants – stored in var Product 4. INPUT: how much of the product/service they want – stored in var Quantity DECISION: confirm: [Name] you ordered [Quantity] of [Product]. Is this correct? If No: OUTPUT: tell customer “Refresh the page to reload and place a new order.” If yes, then continue to step 5. 5. DECISION: Did the customer enter a valid product? If no: OUTPUT: tell customer “Sorry, [Name]. You entered an invalid product.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Refresh the page to reload and place the order again.” If yes, continue to step 6 6. DECISION: does the customer want to order another product? If yes: loop back up the step where you ask the user to input a product name and quantity If no: continue to step 7 7. PROCESS: Calculate the final cost of the order with the corresponding discount . 8. OUTPUT: using document.write say: “Thank you for placing an order with us, [Customer Name]. The total order cost is $[Order Total For All Items (var running total)]”. 9. END...
View Full Document

{[ snackBarMessage ]}