Question
1. Write the class FixedProperty with three attributes location (string), InCity (bool) estimatedValue (double). - Add a constructor with three parameters - Add another constructor
1. Write the class FixedProperty with three attributes location (string), InCity (bool) estimatedValue (double). - Add a constructor with three parameters - Add another constructor with a single parameter to initialize the location, the other two attributes have default values of true and 1000000. - Add a get method to return the location attribute.
2. Write the class Vehicle with three attributes RegistrationNumber (int), maxVelocity (double), Value (double). - Add a constructor with three parameters to initialize the three attributes. - Add a get method to return the lRegistrationNumber attribute.
3. Write the class Bus where each object of this class is a Vehicle. - Add the attribute numberOfSeats (int) - Add a constructor with four parameters to initialize numberOfSeats, regNumber, MaxVelocity, and value attributes - Add a get method to return the numberOfSeats attribute.
4. Write the class House where each object of this class is a FixedProperty. - Add the area attribute (double) - Add a constructor with four parameters to initialize the attributes location, InCity, area, estimatedValue - Add a get method to return the area attribute.
5. Write the interface Itaxable that contains a single method valueTax () which returns a double. 6. write the class TaxableBus where each object of this class is a Bus. - Add a constructor with four parameters to initialize numberOfSeats, regNumber, value, and MaxVelocity attributes - Implement valueTax () method of the Itaxable interface so that the return value is value/10+100 * numberOfSeats.
7. Write the class TaxableHouse where each object of this class is a House. -Add a constructor with four parameters to initialize the attributes location, InCity, area and estimatedValue -Implement the valueTax () method of the Itaxable interface so that the return value is (estimatedValue/1000)*5+5*area if the property is located in town (incity) else the return value is estimatedValue/1000)*3
8. In the main method - Create an array that contains three TaxableHouse type objects and three TaxableBus type objects - Display the tax calculated for each object
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