Question: Introduction to Java Programming, Comprehensive Version 10th Edition, Liang, Chapter 37 Question 5: Write an HTML form to prompt the user to enter taxable income

Introduction to Java Programming, Comprehensive Version 10th Edition, Liang, Chapter 37 Question 5: Write an HTML form to prompt the user to enter taxable income and filing status, as shown in Figure 37.30a. Clicking the Compute Tax button invokes a servlet to compute and display the tax, as shown in Figure 37.30b. Use the computeTax method introduced in Listing 3.7, ComputingTax.java, to compute tax.

package computeTax;

import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped;

@ManagedBean @RequestScoped public class ComputeTax {

int status; double income;

public int getStatus() { return status; }

public void setStatus(int status) { this.status = status; }

public double getIncome() { return income; }

public void setIncome(double income) { this.income = income; } public double getTax() { return computetax(status, income); }

private double computetax(int status, double income) { double tax = 0;

if (status == 0) { // Compute tax for single filers if (income

Introduction to Java Programming, Comprehensive Version 10th Edition, Liang, Chapter 37 Question

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!