import javax.swing.*; public class Resident { private String name; private String address; private String phone; private String sPlot; private double plot; private double tax; double area = Math.PI * Math.pow(plot, 2.0); double rate; public Resident() // default constructor (no parameters) sets data members to default values { name = "Ms. Smith"; address = "First Street"; phone = "123-4567"; plot = 100.0; } public void show() { String s; s = "Name: " + name + "\nAddress: " + address + "\nPhone Number: " + phone + "\nPlot is:" + plot + "\n"; System.out.println(s); area = Math.PI * Math.pow(plot, 2.0); } public void input() { String s; name = JOptionPane.showInputDialog("Enter your name"); address = JOptionPane.showInputDialog("Enter your address"); phone = JOptionPane.showInputDialog("Enter your phone number"); sPlot = JOptionPane.showInputDialog("Enter radius of plot in feet"); plot = Double.parseDouble(sPlot); } public Resident(String n, String a, String p, double pl) // three parameter constructor, set data members to the { name = n; // values of the arguments address = a; phone = p; plot = pl; } public void showTaxRate() { double taxRate; area = Math.PI * Math.pow(plot, 2.0); if(plot > 40000) // no discout (no ; after the boolean condition { tax = area * 0.05735; rate = 5.735; } else if(plot < 20000) { tax = area * 0.01273; rate = 1.273; } else { tax = area * 0.03674; rate = 3.674; } } public void showDueDate() { if( name.compareTo("L") > 0 ) // compares the string at type to the argument { show(); // the method equals considers case } } // public static void main(String[] args) // { JOptionPane.showMessageDialog(null, "*********** TAX BILL ***********" + // "\n For Joe Jones of 1 Second Avenue" + // "\n Your tax rate is 1.273%" + // "\n You owe $1,927.30 due on January 1"); // // } }