Modify the espresso program to include brewed coffee. It comes in a 12 oz. size only and costs $1.00 plus tax.

What will be an ideal response?


7. see below
var price;
var taxRate = 0.088;
var shots = 1;
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);
if (drink == "brewed") {
price = 1.00;
} else {
price = price + (shots - 1) * .50;
}
price = price + price * taxRate

Computer Science & Information Technology

You might also like to view...

What will be output from the following code:

``` public void test 3 ( ) { for ( int x = 1 ; x < 1 0 ; x = x + 2) { System . out . println ( x ) ; } } ```

Computer Science & Information Technology

After creating an instance of a Web service, you can code a(n) ____________________ that calls the Web service.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

New zero-day attacks are announced on a regular basis against a broad range of technology systems. Which of the following best practices should you do first to manage the risks of these attack vectors?

A. Back up all device configurations. B. Establish an emergency response process. C. Create an inventory of applications and critical systems. D. Update all network diagrams.

Computer Science & Information Technology

Which of the following is true of a 32-bit CPU?

A. It cannot effectively utilize more than 4GB of main memory. B. It has a higher speed than any other processor. C. It is ideal for creating large, complicated spreadsheets. D. It is more expensive than the 64-bit CPU.

Computer Science & Information Technology