Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 class 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. a) Implement a Property class. [3 Marks] b) Implement a House class, including a method called housetax, which returns the tax payable on that house. [8 marks] c) Implement a Shop class, including a method called shoptax, which returns the tax payable on that shop. [6 marks] d) 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 those 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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Psychological needs (autonomy, competence and relatedness).

Answered: 1 week ago