You are on page 1of 1

import java.util.*; class tax { double grossPay, netPay, taxAmount; int hrs; tax() { System.out.

println("Enter number of hours worked per month"); Scanner scan= new Scanner(System.in); hrs = scan.nextInt(); grossPay = 12 * hrs; } double calculateTax() { taxAmount= 0.15 * grossPay; return taxAmount; } double calculateNetPay() { netPay = grossPay - taxAmount; return netPay; } }

You might also like