The goal of this lab is to write two programs that do some computing using data values embedded in the code. The two parts equally contributed to the lab grade.
Part (a) Tax Calculation
The goal of this part is to write a class Tax for calculating the income tax of an imaginary country of Bonzo. The tax is calculated from the income, the savings, the stock, the real estate, and the number of children in the family. The income, savings, stock, and real estate values are in dollars and are double variables and the number of children is an int. These variables shall be declared in the code and shall be given values. By changing the values assigned to these variables, different outcomes may result.
The tax formula is the sum of four subtaxes:
There shall be four double variables desginated for these four subtaxes as well as the variable designated for storing the total tax. The program shall compute the four subtaxes and then compute the total. The program then shall print out the outcome of calculation.
You may use the template Tax.java, which produces the part other than the tax calculation and print out.
Part (b) Linear Equation
This part is for writing a class LinearEquation that computes the solution of a set of three diagonalized linear equations:
a1 x = d1,
a2 x + b2 y = d2,
a3 x + b3 y + c3 z = d3
where a1, d1, a2, b2, d2, a3, b3, c3, d3, x, y, and z are all double and the values of a1, d1, a2, b2, d2, a3, b3, c3, and d3 are embedded in the code.
The soltuon can be obtained in the following manner:
The output of the code should look like:
You may use the template LinearEquations.java.