Note that there are some explanatory texts on larger screens.

plurals
  1. POError:class interface or enum expected
    primarykey
    data
    text
    <p>Im using java and keep getting the error:class interface or enum expected. Here is the program, the compiler says the problem is on the last line but i can't figure it out.</p> <pre><code> public class Ch3_PrExercise6 { static Scanner console = new Scanner (System.in); public static void main(String [] args) throws Exception { final double FEDERAL_TAX_RATE = 0.15; final double STATE_TAX_RATE = 0.035; final double SOCIAL_SECURITY_TAX_RATE = 0.575; final double MEDICARE_MEDICAID_TAX_RATE = 0.0275; final double PENSION_PLAN = 0.05; final double HEALTH_INSURANCE = $75; String name; double GrossAmount; double FederalTax; double StateTax; double SocialSecurityTax; double MedicareMedicaidTAx; double PensionPlan; double HealthInsurance; double NetPay; system.out.print("Bill Robinson"); name = console.nextline(); system.out.println(); system.out.println(name); grossAmount = console.nextDouble(); federalTAx = grossAmount * FEDERAL_TAX_RATE; stateTax= grossAmount * STATE_TAX_RATE; SocialSecurityTax = grossAmount * SOCIAL_SECURITY_TAX_RATE; MedicareMedicaidTax = grossAmount * MEDICARE_MEDICAID_TAX_RATE; PensionPlan = grossAmount * PENSION_PLAN_RATE; HealthInsurance = $75; NetPay= grossAmount - federalTax - stateTax - SocialSecurityTax - MedicareMedicaidTax - PensionPlan - HealthInsurance; PrintWriter outfile = new Printwriter("Ch3_Ex6out.txt"); outFile.printf ("Bill Robinson"); outFile.printf ("%n grossAmounT: $%8.2F"); outFile.printf ("%n federalTax $%8.2F"); outFile.printf ("%n stateTax $%8.2F"); outFile.printf ("%n SocialSecurityTax $%8.2F"); outFile.printf ("%n MedicareMedicaidTax $%8.2F"); outFile.printf ("%n Pension Plan $%8.2F"); outFile.printf ("%n HealthInsurance $%8.2F"); outFile.printf ("%n NetPay $%8.2F"); outFile.close(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload