Here are the instructions:
- request the flavor from the user. Flavor choices are: cherry,
lime, watermelon, grape and orange.
- If one of these flavors is entered, request the size from the
user. Size may be small or large.
- If another flavor is entered, alert the user that the flavor is
- Output the cost to the user: $2 for small and $3 for large. No
cost should be output if the flavor was not available.
Add a while loop so that after an order is taken or an invalid
flavor is entered you prompt the user – “Would you like to
order another shave ice? (y/n)”.
- Continue to take orders until the user does not enter y to that
- When the user does not enter y, output the total cost of the
orders taken. ($3 for each large and $2 for each small)
If you are asking about prompt() (antiquated code for Netscape browsers) why did you post in the DOM and JSON forum?
Modern scripts use a form in the page itself to get user input. You then attach an event listener to the submit event on the form to call the processing to process the form input and use DOM calls to output the result into the page.
Start with a <select> and <option>s dropdown and use onchange or a listener.