After just trying to compile what I coded, I made what I hope are appropiate changes. . and so now my program looks like . .
import java.io.*;
import java.util.*;
import javax.swing.JOptionPane;
public class PropertyTax
{
public static void main(String [] args)
throws FileNotFoundException
{
String inputAssessedValueString;
double inputAssessedValue;
double taxableAmount;
double taxRate_hundreds;
double finalPropertyTax;
inputAssessedValueString = JOptionPane.showInputDialog
("Enter assessed value");
inputAssessedValue = Double.parseDouble(inputAssessedValueString);
taxableAmount = 0.92 * inputAssessedValue;
taxRate_hundreds = taxableAmount / 100;
finalPropertyTax = taxRate_hundreds * 1.05;
JOptionPane.showMessageDialog(null,
String.format("The Assessed Value equals $ %.2f%n",inputAssessedValue)
+ String.format("Taxable Amount equals $ %.2f%n", taxableAmount)
+ String.format("Tax Rate each $ 100.00: $ 1.05")
+ String.format("Property Tax equals %.2f%n", finalPropertyTax),
"Property Tax Calculation",
JOptionPane.INFORMATION_MESSAGE);
PrintWriter outFile = new PrintWriter("a:\\proptax.txt");
outFile.close();
}
}
looks like you've got something going! i'll have to take a look at this later, as I'm just about leaving work
A few things.
1) You haven't actually written anything to your file.
2) You really never want to use doubles or floats for monetary quantities. The rounding errors will kill you. Much better to use a dedicated Currency class that uses fixed point arithmetic, though for this exercise it probably doesn't matter.
3) It's usually good programming practice to give constants names rather than embedding literals, but, again, for this exercise it probably doesn't matter.
Other than that it appears to be good, especially if this is your first time trying to write a Java program.