Hey guys im new to java and programming, im taking a introductory course into java and im having trouble with my current assignment. Ok they provided me with a test class and i had to create the main class. so this is what i got.
this is the test class providedpublic class PropertyTax { private static double totalTax; private double AssessedValue; private double TaxableAmount; private double TaxRate; private double Tax; public House(double assvalue, double taxamt, int rate) { AssessedValue = assvalue; TaxableAmount = taxamt; TaxRate = rate; totalTax = assvalue * rate; } public static double getTotalTax() { return totalTax; } public double getAssessedValue() { return AssessedValue; } public double getTaxableAmount() { return TaxableAmount; } public double getTaxRate() { return TaxRate; } public double getTax() { return Tax; } }
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())); } }
i need a lot of help getting this program to compile. I hope you guys could give me some tips that could help me compile my program which is due in a few.
- Thanks ahead of time guys