Alright guys im back. So this time my assignment is there giving me the test class and i have to create the main class. So this is the test class that that gave me.
import java.text.NumberFormat;
class TestPropertytax
{
public static void main(String[] arg)
{
NumberFormat nf = NumberFormat.getCurrencyInstance();
PropertyTax p1 = new PropertyTax(100000, 1.05);
p1.calculate();
print(p1, nf);
System.out.println("----------------------------------");
PropertyTax p2 = new PropertyTax(150000, 1.05);
p2.calculate();
print(p2, nf);
System.out.println("----------------------------------");
System.out.println("Total tax revenue " + nf.format(PropertyTax.totalTax()));
System.out.println("--------- End of report ----------");
}
static void print(PropertyTax p, NumberFormat nf)
{
System.out.println("Assessed value " + nf.format(p.getAssessedValue()));
System.out.println("Taxable amount " + nf.format(p.getTaxableAmount()));
System.out.println("Tax rate for each $100.00 is " + nf.format(p.getTaxRate()));
System.out.println("Property tax is " + nf.format(p.getTax()));
}
}
So im here to see if you guys can give me some tips on how to get the program up and running.
This is my main class so far
public class PropertyTax
{
private static double totalTax;
private static double TaxableAmount;
private static double AssessedValue;
import java.text.NumberFormat;
class TestPropertytax
{
public static void main(String[] arg)
{
NumberFormat nf = NumberFormat.getCurrencyInstance();
PropertyTax p1 = new PropertyTax(100000, 1.05);
p1.calculate();
print(p1, nf);
System.out.println("----------------------------------");
PropertyTax p2 = new PropertyTax(150000, 1.05);
p2.calculate();
print(p2, nf);
System.out.println("----------------------------------");
System.out.println("Total tax revenue " + nf.format(PropertyTax.totalTax()));
System.out.println("--------- End of report ----------");
}
static void print(PropertyTax p, NumberFormat nf)
{
System.out.println("Assessed value " + nf.format(p.getAssessedValue()));
System.out.println("Taxable amount " + nf.format(p.getTaxableAmount()));
System.out.println("Tax rate for each $100.00 is " + nf.format(p.getTaxRate()));
System.out.println("Property tax is " + nf.format(p.getTax()));
}
}
So im here to see if you guys can give me some tips on how to get the program up and running.
This is my main class so far
public class PropertyTax
{
private static double totalTax;
private static double TaxableAmount;
private static double AssessedValue;