Write the code to complete a method, printServiceCost(), as…
Write the code to complete a method, printServiceCost(), as defined below. The method receives the service type as an integer (1 – 5). It calculates and displays the type of service performed, the cost, tax and total to the console. The method uses a constant named TAX_RATE set at 6% in its calculations. The services available and rate are: Cost of Services SERVICE TYPE COST 1 – Oil change $35.99 2 – Tire rotation $20.95 3 – Wiper blade replacement $45.95 4 – Car wash $10.99 5 – Car wax $15.99 The result of the calculations are output to the console. For example, service type 2 will result in the following output: Service provided: Tire rotation. $20.95Tax amount: $1.26Total due: $22.21 Code submitted in the text box supplied must include the complete method signature and body, using the correct data types based on the problem statement.
Read Details