i am writing a tax program and I have this error that I cant figure out.... java:19: incompatible types
found : java.lang.String
required: double
double incomeValue = income;
and
java:20: incompatible types
found : java.lang.String
required: double
double dependentsValue = dependents;
Here is my source code:
import java.io.*;
import javax.swing.JOptionPane;
public class StateTax
{
public static void main(String[] args) throws IOException
{
BufferedReader inData;
inData = new BufferedReader(new InputStreamReader(System.in));
//declaring Variables
String income, dependents;
double StateTaxDue;
double incomeValue = income;
double dependentsValue = dependents;
//user input
System.out.println("State Tax Computation");
income = JOptionPane.showInputDialog(null, "Taxpayers Income:");
dependents = JOptionPane.showInputDialog(null, "Number Of Dependents:");
//Conversions
StateTaxDue = 0.03 * incomeValue - (600 * dependentsValue);
//output
JOptionPane.showMessageDialog(null, "State Tax Due:" + StateTaxDue);
System.exit(0);
}
}


Reply With Quote


Bookmarks