Question: You use an escape sequence to include ___________________ in a string Question 5 Code example 2-1 import java.util.Scanner; public class InvoiceApp { public static void
You use an escape sequence to include ___________________ in a string Question 5 Code example 2-1 import java.util.Scanner; public class InvoiceApp { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String choice = "y"; while (choice.equals("y")) { System.out.print("Enter subtotal: "); double subtotal = sc.nextDouble(); double salesTax = subtotal * .0875; double invoiceTotal = subtotal + salesTax; String message = "Subtotal = " + subtotal + " " + " Sales tax = " + salesTax + " " + "Invoice total = " + invoiceTotal + " " System.out.println(message); System.out.print("Continue? Enter y or n: "); choice = sc.next(); } } } (Refer to code example 2-1.) If the user enters 100 the first time the while loop is executed, what will the program display at the console? a. Subtotal: 100.0 Sales tax: 8.75 Invoice total: 108.75 b. Subtotal = 100.0 Sales tax = 8.75 Invoice total = 108.75 c. Subtotal = 100.0 Sales tax = 8.75 Invoice total = 108.75 d. Subtotal = 100.0 Sales tax = 8.75 Invoice total = 108.75 What is the value of the variable named counter after the statements that follow are executed? double percent = 0.54; boolean valid = true; int counter = 1; if ((percent > 0.50) && (valid == true)) { counter += 2; if (valid == true) { counter++; } else if (percent >= 0.50){ counter += 3; } } else { counter++; } a. 4 b. 7 c. 3 d. 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
