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
An application with a 150 GB relational database runs on an EC2 Instance. While the application is used infrequently with small
kupik [55]

Answer:

the bandman is hered that mybaddba

4 0
3 years ago
You plan to use the Fill Down feature on a formula and you need to keep a cell reference the same. Which one of the following fo
viva [34]
You have to use this format for example $A$2
The format for absolute reference is designated with a dollar sign ($). If both column and, put a dollar sign before and in between the row and column. By doing this, column and row do not change when copied.
3 0
3 years ago
Use the five-step decision-making process discussed in Chapter 1 to analyze the following situations and recommend a course of a
RideAnS [48]

Answer:

The responses to this question can be defined as follows:

Explanation:

Yeah, their numerous sponsorships brands have potential. Every business does have its Trademarks for a commodity, that distinguishes others. It's an infringement for trademarks, it has only provided to those trivialities, which success and if I would plan this for my friend. I would never list or show those points of his accomplishments I never would Numerous sponsors. This should include all its information using its trademarks as well as other Site partners are excluded even though they are or are browsing their trademarks where the law is prohibited.

7 0
3 years ago
HELP!! WHATS THE ANSWER??
dsp73

Answer:

"sing" that is the answer

Explanation:

6 0
3 years ago
Read 2 more answers
Write a note on secondary storage​
nikdorinn [45]

Answer:

Secondary storage is non volatile,long term storage .Without secondary storage all programs and data would be lost the moment the computer is switched off .There are three main types of secondary storage in a computer system- 1.solid state storage devices such as USB memory sticks.2.optical storage devices such as CD,DVD ext.3.magnetic storage devices ,such as hard disk drives.

8 0
3 years ago
Other questions:
  • To include totals and other statistics at the bottom of a datasheet, click the ____ button on the HOME tab to include the Total
    12·1 answer
  • The memory allocated for a float value is ____ bytes.
    9·1 answer
  • What are the two main things an operating system does?
    14·1 answer
  • Which method deletes a footer from a document?
    13·2 answers
  • Programming challenge description: Given a string comprising just of the characters (,),{,},[,] determine if it is well-formed o
    13·1 answer
  • How does white balancing affect the images recorded by a camera?
    15·1 answer
  • What is an advantage of unicode over ascii?
    10·1 answer
  • Consider the method get Hours, which is intended to calculate the number of hours that a vehicle takes to travel between two mil
    6·1 answer
  • List out the storage measurements units of a computer .<br><br>​
    10·2 answers
  • Write a program with a "function" named "getMinFromInput()" that reads a list of integers from the keyboard and returns the smal
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!