Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions