Now we’re ready to actually compute a tax amount. Here’s a minimal example which calculates federal tax.
- Enter Code
Enter the following code in a file named ‘Compute.cs’:
Enter the following code in a file named ‘Compute.java’:
This minimal code
- chooses the tax table data file,
- selects the tax to compute,
- sets the earnings per pay period to $5000, and
- computes the tax.
Default values are taken, which for most properties is zero, except PayPeriodsPerYear which defaults to 12 (monthly).
- Compile
Compile the code at the command prompt by executing the following:
- Run
Run the code by typing:
The program’s output should show the computed federal tax.