The correct answer is A. A1!
Not sure. if youre online try messing with the filters if there are some, if youre on the app try updating it.
Answer:
Scanner keyboard = new Scanner(System.in);
double discount = 0;
double productPrice;
double subTotal;
double salesTax;
double saleTotal;
System.out.printf("Enter the purchase amount:");
productPrice = keyboard.nextDouble();
if (productPrice > 10) {
discount = 10;
}
System.out.println( + discount + "% discount applied.");
subTotal = (productPrice);
salesTax = (subTotal * 0.14);
saleTotal = (subTotal + salesTax - discount );
System.out.printf("Subtotal: $%5.2f\n", subTotal);
System.out.printf("Discount; -$%5.2f\n", productPrice - discount);
System.out.printf("HST: $%5.2f\n", salesTax);
System.out.printf("Total: $%5.2f\n", saleTotal + salesTax);
}
}
Explanation:
Answer:
See Explaination
Explanation:
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class GradesAverage {
private static int checkNum(String num) {
int tmpNum;
try {
tmpNum = Integer.valueOf(num);
} catch(IllegalArgumentException e) {
System.out.println("You did not enter an integer.");
return -1;
}
return tmpNum;
}
private static boolean validNum(int num) {
if(num>=0 && num<=100) {
return true;
}
System.out.println("You did not enter an integer, try again
Answer:
<u>D.Analyze and Design</u>