create several constructors including copy constructor , create accessor and mutator methods
Part 2 (50 points)
It should have the following field : double value_of_improvements
Create a constructor for this class to include newly added fields.
The tax for the private property should be calculated as
0.02* (property_value - value_of_improvements)
It should have the following fields: double advertising_cost, double professional_expences
Create a constructor for this class.
The tax should be calculated as 0.02* (property_value - advertising_cost - professional_expences)
Part 3 (50 points)
What you need to submit:
Note: Could you plz go through this code and let me
know if u need any changes in this.Thank You
=================================
// Taxable.java
public interface Taxable {
double getPropertyTax();
}
=============================
// Building.java
public class Building {
private String address;
private double property_value;
/**
* @param address
* @param property_value
*/
public Building(String address, double property_value)
{
this.address = address;
this.property_value =
property_value;
}
public Building(Building b) {
this.address = b.address;
this.property_value =
b.property_value;
}
/**
* @return the address
*/
public String getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(String address) {
this.address = address;
}
/**
* @return the property_value
*/
public double getProperty_value() {
return property_value;
}
/**
* @param property_value the property_value to
set
*/
public void setProperty_value(double property_value)
{
this.property_value =
property_value;
}
}
=================================
// Private_Property.java
public class Private_Property extends Building
implements Taxable {
private double
value_of_improvements;
/**
* @param address
* @param property_value
* @param value_of_improvements
*/
public Private_Property(String address, double
property_value,
double
value_of_improvements) {
super(address,
property_value);
this.value_of_improvements =
value_of_improvements;
}
@Override
public double getPropertyTax() {
return 0.02 *
(getProperty_value() - value_of_improvements);
}
/**
* @return the value_of_improvements
*/
public double getValue_of_improvements() {
return value_of_improvements;
}
/**
* @param value_of_improvements the
value_of_improvements to set
*/
public void setValue_of_improvements(double
value_of_improvements) {
this.value_of_improvements =
value_of_improvements;
}
}
===================================
// Commercial_Property.java
public class Commercial_Property extends Building
implements Taxable {
private double advertising_cost;
private double professional_expences;
/**
* @param address
* @param property_value
* @param advertising_cost
* @param professional_expences
*/
public Commercial_Property(String address, double
property_value,
double advertising_cost, double
professional_expences) {
super(address, property_value);
this.advertising_cost = advertising_cost;
this.professional_expences =
professional_expences;
}
/**
* @return the advertising_cost
*/
public double getAdvertising_cost() {
return advertising_cost;
}
/**
* @param advertising_cost the advertising_cost to
set
*/
public void setAdvertising_cost(double
advertising_cost) {
this.advertising_cost =
advertising_cost;
}
/**
* @return the professional_expences
*/
public double getProfessional_expences() {
return professional_expences;
}
/**
* @param professional_expences the
professional_expences to set
*/
public void setProfessional_expences(double
professional_expences) {
this.professional_expences =
professional_expences;
}
@Override
public double getPropertyTax() {
return 0.02* (getProperty_value() -
advertising_cost - professional_expences);
}
}
=======================================
// Demo.java
public class Demo {
public static void main(String[] args) {
double
tax_Private_Property ,tax_Commercial_Property;
Private_Property pp=new
Private_Property("Park Street,Delhi",450000,34000);
tax_Private_Property=pp.getPropertyTax();
Commercial_Property cp=new
Commercial_Property("Church Street,Banglore", 980000, 2500,
34000);
tax_Commercial_Property=cp.getPropertyTax();
System.out.println("Tax For Private
Property :$"+tax_Private_Property);
System.out.println("Tax For
Commercial Property :$"+tax_Commercial_Property);
}
}
=================================
output:
Tax For Private Property :$8320.0
Tax For Commercial Property :$18870.0
=====================Could you plz rate me well.Thank You
Design a class called Building. The class should keep the following information in the fields: String...
JAVA HELP Design a class named Employee. The class should keep the following information in fields: Employee name Employee number in the format XXX–L, where each X is a digit within the range 0–9 and the L is a letter within the range A–M. Hire date then, Write one or more constructors and the appropriate accessor and mutator methods for the class. Next, write a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to...
WRITE IN C++ ONLY PLEASE. IM USING VISUAL STUDIO CODE.1. Employee and ProductionWorker ClassesDesign a class named Employee. The class should keep the following information in• Employee name• Employee number• Hire dateWrite one or more constructors and the appropriate accessor and mutator functions for the class.Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information:• Shift (an integer)• Hourly pay rate (a double )The workday...
Java Program: Design a class “Book” with the data attributes title - String, author - String, yearPublished - integer and price - double. Write a parameterized constructor that initializes the attributes. Write accessor and mutator methods, and a print method that prints all of the attributes. In the main method, create a single object and give it values of your choice. Call the print method to print the values. Sample Run: The Book is: The Art of Computer Programming Donald...
Language is JAVA.
Clarification for the Shape class (highlighted):
The following requirements specify what fields you are expected
to implement in your Shape class;
- A private String color that specifies the color of the
shape
- A private boolean filled that specifies whether the shape is
filled
- A private date (java.util.date) field dateCreated that
specifies the date the shape was created Your Shape class will
provide the following constructors;
- A two-arg constructor that creates a shape
with...
Design a class named Person with fields for holding a person's name, address, and telephone number (all as Strings). Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class. The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes...
Please create a UML for a class called Employee It will have a lastName as a String It will have a salary as a double It will have vacDays as an int It will have a no argument constructor that sets lastName to null, salary to 0.0 and vacation days to 15 It will have an argument constructor. It will have 3 accessor and 3 mutator methods It will have a showInfo() as a void method to display all the...
Design a JAVA class called Course. The class should contain: ○ The data fields courseName (String), numberOfStudents (int) and courseLecturer (String). ○ A constructor that constructs a Course object with the specified courseName, numberOfStudents and courseLecturer. ○ The relevant get and set methods for the data fields. ○ A toString() method that formats that returns a string that represents a course object in the following format: (courseName, courseLecturer, numberOfStudents) ● Create a new ArrayList called courses1, add 5 courses to...
Code should be in C# Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 – this interest should be added to savingsBalance. Provide static method setAnnualInterestRate to set the annualInterestRate to a new value....
Using JAVA* Design a class named Person with fields for holding a person’s name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class’s fields. Next, design a class named Customer, which extends the Person class. The Customer class should have a field for a customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write one or more constructors and the appropriate mutator...
Car class Question Design a class named car that has the following fields: YearModel: The yearModel field is an integer that holds the car's year model. Make: The make field references a string that holds the make of the car. Speed: The speed field is an integer that holds the car's current speed. In addition, the class should have the following constructor and other methods: Constructor: The constructor should accept the. car's year model and make as arguments. The values...