Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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: 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 Cari Public 2005 19 6 2015 23 24 Car2 Car3 Cart Private Private 2000 23 0 Public 2010 21 3 Sample Runt: run: Cari: 57000 LBP. Car2: 1380000 LBP. Car3: 115000 LBP. Card: 262500 LBP
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started