Question
JAVASCRIPT Simple sales app: Your web site sells bags of coffee for the Save the Aardvarks Foundation. You sell regular coffee at $9/bag, you sell
JAVASCRIPT
Simple sales app:
Your web site sells bags of coffee for the Save the Aardvarks Foundation. You sell regular coffee at $9/bag, you sell decaffeinated coffee at $8/bag, and you sell mocha coffee for $11/bag. If the user buys more than $100 worth, they get a $15 discount. Use the prompt to ask the user how many bags of regular coffee s/he wants. Then use the prompt to ask about decaf, and then about mocha. Using the input, calculate the total amount the user will pay.
2. If the total is over $100, subtract $15 from their total. Write out their receipt to the web page, by writing out how many bags of regular they purchased and how much that works out to, then how many bags of decaf and how much that works out to, and then how many bags of mocha they purchased and how much that works out to. Finally write out how much the total will be. So, for example, after running the script, the web page might look like this: You purchased 3 bags of regular, totaling 27 dollars. You purchased 2 bags of decaf, totaling 16 dollars. You purchased 6 bags of mocha, totaling 66 dollars. Your total purchase cost is 93 dollars.
what information do you need? everything is here. thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started