Im trying to make a program that takes taxpayer information and their tax dues.
The tax due depends on income and marital status (single, married, or divorced and 0-20000, 20001-50000, or 50000+), i can probably figure this out later but im pretty stumped right now.
this is my full error message:
Method setTaxes in class TaxPayer content be applied to given types:
required: double, char, double
found: double
reason: actual and formal argument lists differ in length
Did i mess anything up?
I wrote //here over the lines of code i need help with
/* Week 1 Assignment TaxPayer */ public class TaxPayer { private int social; private String lastName; private String firstName; private String address1; private String address2; private String city; private String state; private int zip; private double income; private char marital; //here private double taxes; public TaxPayer(int socialIn, String lastNmIn, String firstNmIn, String add1In, String add2In, String cityIn, String stateIn, int zipIn, double incomeIn, char maritalIn, //Here double taxesIn ) { setSocial(socialIn); setLastNm(lastNmIn); setFirstNm(firstNmIn); setAdd1(add1In); setAdd2(add2In); setCity(cityIn); setState(stateIn); setZip(zipIn); setIncome(incomeIn); setMarital(maritalIn); //here, this is where the error pops up setTaxes(taxesIn); } public void setSocial(int socialIn) { if(socialIn>0) { social=socialIn; } else { social=0; } } public void setLastNm(String lastNmIn){ lastName=lastNmIn; } public void setFirstNm(String firstNmIn){ firstName=firstNmIn; } public void setAdd1(String add1In){ address1=add1In; } public void setAdd2(String add2In){ if(add2In.equals("")){ address2="null"; } else{ address2=add2In; } } public void setCity(String cityIn){ city=cityIn; } public void setState(String stateIn){ state=stateIn; } public void setZip(int zipIn){ if(zipIn>0){ zip=zipIn; } else{ zip=0; } } public void setIncome(double incomeIn){ if (incomeIn>0){ income=incomeIn; } else{ income=0; } } public void setMarital(char maritalIn){ marital=maritalIn; } /* Income: Tax Rate: Single Tax Rate: Married Tax Rate: Divorced 0-20,000 15% 14% 13% 20,001 - 50,000 22% 21% 20% Over 50,000 30% 28% 26% */ //Here public void setTaxes(double taxesIn, char maritalIn, double incomeIn){ if(incomeIn<20000.00&&maritalIn=='S'){ taxes=0.15*20000.0; } } public int getSocial(){ return social; } public String getLastNm(){ return lastName; } public String getFirstNm(){ return firstName; } public String getAdd1(){ return address1; } public String getAdd2(){ return address2; } public String getCity(){ return city; } public String getState(){ return state; } public int getZip(){ return zip; } public double getIncome(){ return income; } public char getMarital(){ return marital; } //And here public double getTaxes(){ return taxes; } }