Step through each line of the JavaScript program below. (This is the program from Figure 17.1.) Write down the value of each variable as you walk through it.
Use an order of a 16 oz. latte with 2 shot.
var price;
var taxRate = 0.088;
if (drink == "espresso")
price = 1.40;
if (drink == "latte" || drink == "cappuccino") {
if (ounce == 8)
price = 1.95;
if (ounce == 12)
price = 2.35;
if (ounce == 16)
price = 2.75;
}
if (drink == "Americano")
price = 1.20 + .30 * (ounce/8);
price = price + (shots - 1) * .50;
price = price + price * taxRate
see table below
You might also like to view...
Define a function named average_grade. This function returns a double and has four double arguments, test1, test2, test3, test4. The return value should be the average, or arithmetic mean of the four arguments. Be sure to include a comment that tells briefly what the function does.
What will be an ideal response?
Word processing software is used to:
A) format documents B) edit documents C) create documents D) all of the above
Elements can be inserted in the middle of a deque container.
Answer the following statement true (T) or false (F)
Ken has discovered that a vice president of his company has been using his computer to send data about a new product to a competitor. Ken has identified an email from the vice president and has tracked the information to the person at the other company. Ken has archived the evidence that proves the data has been sent. ? What should Ken do next?
A. Report the person through proper channels. B. Approach the VP and ask him about the email. C. Ignore the email; it is not his job. D. Go right to the president of the company.