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”)) {...


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 + “\n”
+ “ Sales tax = ” + salesTax + “\n”
+ “Invoice total = ” + invoiceTotal + “\n\n”
System.out.println(message);
System.out.print(“Continue? Enter y or n: ”);
Choice = sc.next();
}
}
}
38. (Refer to code example 2-1.) If the user enters “Y” when asked if he/she wants to continue, the application will a. repeat the while loop b. display a blank line, then repeat the while loop c. End



Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here