1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuki888 [10]
3 years ago
9

Create an abstract class Homeowner. Your Homeowner class should include the following attributes: First name (string) Last name

(string) Homeowner home street address (string) Homeowner home city (string) Homeowner home state (string) Homeowner home county (string) Write a constructor to initialize the above Homeowner attributes. Create an abstract method called propertyTaxes.
Computers and Technology
1 answer:
serious [3.7K]3 years ago
4 0

Answer:

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:

You might be interested in
Help plzzzzzzzzzzzzzzzzzzzzzzzzz
Reil [10]

B, Parallel ports are faster than serial ports.

A parallel port can move a set of 8 bits at a time on eight different wires, it uses a 25 pin connector, called a DB-25 connector, whereas a serial port only has a DB-9 connector.

7 0
3 years ago
Once the reaction time experiment in your MakeCode micro:bit program is
scZoUnD [109]

Once the reaction time experiment in your MakeCode micro:bit program is complete, Review the tutorial video to make sure you've completed all the steps correctly.

<h3>What is reaction time experiment?</h3>

A  reaction time experiment is known to be one that has different set of neural processes. This experiment is known to be one that has been set up to measure or look into the response time for something that one can see.

Note that when the reaction time experiment in your MakeCode micro:bit program is complete, it is better to go over the tutorial video to be sure you that you have completed all the steps correctly.

learn more about reaction time from

brainly.com/question/6167212

5 0
2 years ago
To use patterns and observations to say what happens next
posledela
You would need to show a pic
4 0
3 years ago
What affect did the Scopes trial have on the school curriculum in Tennessee?
Bad White [126]
D)It did not change the curriculum because Scopes lost the case.
4 0
3 years ago
Read 2 more answers
The classification of clouds is based on their _____.
goblinko [34]
Clouds might be ordered by shape and by height. Luke Howard, a British drug specialist was the first to portray cloud shapes utilizing Latin terms, for example, cirrus, cumulus or stratus. The division of mists into ten fundamental cloud structures or cloud genera depends on his productions.
5 0
3 years ago
Read 2 more answers
Other questions:
  • What is the danger in judging someone according to his or her social networking profile
    12·1 answer
  • Who is president is US
    5·1 answer
  • What is a program that, when installed on a computer, records every keystroke and mouse click?
    11·1 answer
  • True or false? Main Content (MC) may include links on the page.
    6·1 answer
  • A _____ is a network that uses multiple access points to link a series of devices that speak to each other to form a network con
    10·1 answer
  • Because many mobile devices and personal computers today are continually connected to the Internet, securing those devices again
    6·1 answer
  • Natalie is a secretary and must complete a large amount of filing this afternoon. At 1:00 PM, the office receptionist gets sick
    10·1 answer
  • Plzz help will mark brainliest
    6·1 answer
  • What is star topology
    15·2 answers
  • I know that this will be taken down for not being a real question but is anyone else not able to search for anything? I can type
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!