Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 A local government treasury department is designing software to work out the total yearly tax due on properties in the area. Since there

image text in transcribed

Question 5 A local government treasury department is designing software to work out the total yearly tax due on properties in the area. Since there are different rules for taxing residential properties (houses) and commercial properties (shops), it was decided to introduce a hierarchy of classes. At the top is the Property, which holds the owner's name and the estimated property value (these are passed as constructor's parameters). There are two subclasses, House and Shop, derived from Property. Each house is assigned a band, depending on its value: the band is 0 if the value does not exceed 100000,1 if it is between 100000 and 500000 , and 2 if it exceeds 500000 . The tax payable on a house is computed as value*( r1+r2 band), where r1 and r2 are two double numbers passed as constructor's parameters. The tax payable on a shop is computed as value*r, where r is a double number passed as constructor's parameter. (i) Implement a Property class. [3 Marks] (ii) Implement a House class, including a method called houseTax, which returns the tax payable on that house. [8 marks] (iii) Implement a Shop class, including a method called shopTax, which returns the tax payable on that shop. [6 marks] (iv) Write a method called totalTax, which takes as parameters two ArrayLists, one containing houses and the other containing shops, and returns the total tax payable on all these properties. [8 marks]

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

The links between existential psychology and positive psychology.

Answered: 1 week ago

Question

What are the various ways that an offer might come to an end?

Answered: 1 week ago