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
Which feature of vitualization helps increase the IT productivity of a business?
laila [671]
A the answer is yes
7 0
3 years ago
Consider the latency model for static congestion windows. If the server receives an acknowledgement for the first data segment i
Angelina_Jolie [31]

Answer:

Latency of an object O is shown below.

Explanation:

W segment and stalled state transmits nothing and waits for acknowledgement. The latency is 2 R TT + the time required for server that are using to transmit the object + the amount of time when server is in stalled state. Let K be the number of window that is K= O/WS .The serveries stalled state where K-1 is period of ime with period lasting RTT-(W-1)S/R

latency = 2RTT +O/R +(K-1)[S/R +RTT - WS/R]

After combining the two case

latency = 2 RTT + O/R + (K-1)[S/R +RTT - WS/R]

where [x] means maximum of (x.0). This is the complete ananlysis of the static windows.

server time for transmit the object is (K-1)[S/R +RTT - WS/R]

7 0
3 years ago
For which product would the producer keep a high profit margin and offer after-sales service?
Zina [86]

What are the products?

6 0
4 years ago
What is a programming method that provides for interactive modules to a website?
Veseljchak [2.6K]

Answer:

Java?

Explanation:

8 0
4 years ago
Write a java program as follows Write a method called powOfTwo that takes an integer as parameter, computes, and outputs it’s sq
Kisachek [45]

Answer:

public static int powOfTwo(int input) {

 return input*input;

}

You will have to call this method in main
for printing it, write

System.out.println(powOfTwo(your number));

in public static void main(str[]args) {

}

8 0
2 years ago
Other questions:
  • Hi Im really a girl and i want to know how to change my username without having to make a new account?
    9·2 answers
  • A lever has an effort arm that is 8 meters long and the residence (load) arm that is 1.5 meters long, how much effort is needed
    7·1 answer
  • Transmits data as pulses of light through tiny tubes of glass Uses standard telephone lines to create a high-speed connection Co
    5·1 answer
  • Assuming you have a TCF free student checking account, how many maximum overdraft fees can you incur in one day?
    12·1 answer
  • You are requesting information about wireless connectivity for your workplace computers. Because you expect the information to b
    15·1 answer
  • private int product(int n) { if(n <= 1) return 1; else return n * product(n-2); } What is the output when product(6) is calle
    6·1 answer
  • Question #3
    12·1 answer
  • Javed’s teacher tells him she would like to see him improve his speaking skills in the next debate by including a rhetorical app
    9·1 answer
  • Draw truth table for the following logic circuit:<br><br> (Please I really need help with this)
    15·1 answer
  • Discussion Topic
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!