Question: Code in Java and used variables and constants to improve readability and reduce redundancy. public class Receipt { public static void main(String[] args) { final
Code in Java
and used variables and constants to improve readability and reduce redundancy. public class Receipt \{ public static void main(String[] args) \{ final double TAX_RATE =0.08; final double TIP_RATE =0.2; double subtotal =38+40+30; double tax = subtotal * TAX_RATE; double total = subtotal + tax + tip; System.out.println("Subtotal: \( \$ "+ \)quot;+ subtotal); System.out.println ("Tax: \( \$ "+\operatorname{tax} \)quot;+tax ); System.out.println("Tip: \$" + tip); System.out.println("Total: \$" + total); 3 1. one that is passed the subtotal and tax rate and returns the tax 2. one that is passed the subtotal and tip rate and returns the tip variables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
