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 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 void show()
	{  String s;
	   s = "Name: " + name +
		   "\nAddress: " + address +
		   "\nPhone Number: " + phone +
		   "\nPlot is:" + plot + "\n";
		System.out.println(s);
     	
		JOptionPane.showMessageDialog(null, "*********** TAX BILL ***********" +
											"\n For " + name + " of " + address +
											"\n Your tax rate is " + showTaxRate() + " on " + showDueDate()); 

			
		area = Math.PI * Math.pow(plot, 2.0);
	}
	
    
    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 double 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;
      }
   return rate;


    }
   
	  public String showDueDate()
  {
      Character x = 'L';
      if(Character.valueOf(name.charAt(0)) < Character.valueOf(x))
        return "January 1st";	//Date for names A - K

      else
        return "June 1st"; 	//Date for names L - Z
  }
   	


}
