1. Write the method getTax having the following header. The method takes as parameters: if the car is public or not, the car year, the car power and the retard months. The method computes and returns...


1. Write the method getTax having the following header. The method takes as parameters: if the car is public or not,<br>the car year, the car power and the retard months. The method computes and returns the mechanic tax for this<br>car.<br>public static double getTax(boolean isPublic, int year, int power, int retard)<br>Using java<br>The tax is computed as follows:<br>• The unit yearly tax is:<br>O For public cars: 2000 LBP if year is 2008 or before and 10000 LBP if year is after 2008<br>o For private cars: 5000 LBP if year is 2008 or before and 20000 LBP if year is after 2008<br>The yearly tax power x unit yearly tax<br>The mechanic tax = yearly tax + retard penalty<br>Retard penalty = retard x yearly tax / 12<br>2. Write a test program (main) that computes and displays the mechanic fees for the following cars:<br>Type<br>Year<br>Power<br>Retard<br>Carl<br>Public<br>2005<br>19<br>Car2<br>Private<br>2015<br>23<br>24<br>Car3<br>Private<br>2000<br>23<br>Car4<br>Public<br>2010<br>21<br>Sample Runt:<br>run:<br>Carl: 57000 LBP.<br>Car2: 1380000 LBP.<br>Car3: 115000 LBP.<br>Car4: 262500 LBP.<br>

Extracted text: 1. Write the method getTax having the following header. The method takes as parameters: if the car is public or not, the car year, the car power and the retard months. The method computes and returns the mechanic tax for this car. public static double getTax(boolean isPublic, int year, int power, int retard) Using java The tax is computed as follows: • The unit yearly tax is: O For public cars: 2000 LBP if year is 2008 or before and 10000 LBP if year is after 2008 o For private cars: 5000 LBP if year is 2008 or before and 20000 LBP if year is after 2008 The yearly tax power x unit yearly tax The mechanic tax = yearly tax + retard penalty Retard penalty = retard x yearly tax / 12 2. Write a test program (main) that computes and displays the mechanic fees for the following cars: Type Year Power Retard Carl Public 2005 19 Car2 Private 2015 23 24 Car3 Private 2000 23 Car4 Public 2010 21 Sample Runt: run: Carl: 57000 LBP. Car2: 1380000 LBP. Car3: 115000 LBP. Car4: 262500 LBP.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here