Java Reference
In-Depth Information
Now let us compute the taxes due, given a filing status and an income figure. First,
we must branch on the filing status. Then, for each filing status, we must have
another branch on income level.
The two-level decision process is reflected in two levels of
if
statements. We say
that the income test is nested inside the test for filing status. (See
Figure 5
for a
flowchart.)
Figure 5
Income Tax Computation Using 1992 Schedule
199
200
ch05/tax/TaxReturn.java
1 /**
2
A tax return of a taxpayer in 1992.
3 */
4 public class TaxReturn
5 {
6 /**
7
Constructs a
TaxReturn
object for a given income and
8 marital status.