import java.util.Scanner;
abstract class Homeowner
{
 private String firstName,lastName,streetAddress,city,state,county;
Â
 public Homeowner(String firstName,String lastName,String streetAddress,String city,String state,String county)
 {
 this.firstName = firstName;
 this.lastName = lastName;
 this.streetAddress = streetAddress;
 this.city = city;
 this.state = state;
 this.county = county;
  Â
 }
Â
 public abstract double propertyTaxes();
Â
}
class countyNeighbor extends Homeowner
{
 private double propertyValue,countyTaxRate;
Â
 public countyNeighbor(String firstName,String lastName,String streetAddress,String city,String state,String county,double propertyValue,double countyTaxRate)
 {
   super(firstName,lastName,streetAddress,city,state,county);
   this.propertyValue = propertyValue;
   this.countyTaxRate = countyTaxRate;
 }
 public double propertyTaxes()
 {
   return propertyValue * countyTaxRate;
 }
Â
}
class Test
{
 public static void main (String[] args)
 {
   Scanner input = new Scanner(System.in);
  Â
   System.out.println("Enter firstName of the homeowner : ");
   String firstName = input.next();
   System.out.println("Enter lastName of the homeowner : ");
   String lastName = input.next();
   System.out.println("Enter streetAddress of the homeowner : ");
   String streetAddress = input.next();
   System.out.println("Enter city of the homeowner : ");
   String city = input.next();
   System.out.println("Enter state of the homeowner : ");
   String state = input.next();
   System.out.println("Enter county of the homeowner : ");
   String county = input.next();
   System.out.println("Enter propertyValue of the homeowner : ");
   double propertyValue = input.nextDouble();
   System.out.println("Enter countyTaxRate of the homeowner : ");
   double countyTaxRate = input.nextDouble();
  Â
   countyNeighbor cn = new countyNeighbor(firstName,lastName,streetAddress,city,state,county,propertyValue,countyTaxRate);
  Â
   System.out.println("Property Tax = $"+ cn.propertyTaxes());
  Â
  Â
   System.out.println("Enter firstName of the homeowner : ");
   firstName = input.next();
   System.out.println("Enter lastName of the homeowner : ");
   lastName = input.next();
   System.out.println("Enter streetAddress of the homeowner : ");
   streetAddress = input.next();
   System.out.println("Enter city of the homeowner : ");
   city = input.next();
   System.out.println("Enter state of the homeowner : ");
   state = input.next();
   System.out.println("Enter county of the homeowner : ");
   county = input.next();
   System.out.println("Enter propertyValue of the homeowner : ");
   propertyValue = input.nextDouble();
   System.out.println("Enter countyTaxRate of the homeowner : ");
   countyTaxRate = input.nextDouble();
  Â
   countyNeighbor cn1 = new countyNeighbor(firstName,lastName,streetAddress,city,state,county,propertyValue,countyTaxRate);
  Â
   System.out.println("Property Tax = $"+ cn1.propertyTaxes());
 }
}
Output:
Enter firstName of the homeowner : John
Enter lastName of the homeowner : Smith
Enter streetAddress of the homeowner : 345,downstreet Â
Enter city of the homeowner : NY
Enter state of the homeowner : NY
Enter county of the homeowner : Albany Â
Enter propertyValue of the homeowner : 56788.00 Â
Enter countyTaxRate of the homeowner : 0.07
Property Tax = $3975.1600000000003
Enter firstName of the homeowner : Cathy Â
Enter lastName of the homeowner : Jones Â
Enter streetAddress of the homeowner : 456,lane-2 Â
Enter city of the homeowner : NY Â
Enter state of the homeowner : NY Â
Enter county of the homeowner : Â Bronx Â
Enter propertyValue of the homeowner : 36762.00 Â
Enter countyTaxRate of the homeowner : 0.08
Property Tax = $2940.96
Explanation: