Juya
-1
Q:

Write a class that accepts a user’s hourly rate of pay and the number of hours worked. Display the user’s gross pay, the withholding tax (15% of gross pay), and the net pay (gross pay – withholding). Save the class as Payroll.cs. As illustrated belo

System.out.println("Withholding tax: $ + withholdingtax");		tax = .15;		withholdingtax = (grosspay * tax);
1
System.out.println("You worked " + hours + "at $ + rate");
0
double tax = 0.15;		double withholdingtax = (grosspay * tax);System.out.println("Withholding tax: $"+ withholdingtax);
0
System.out.println("You worked " + hours + "at $" + rate);
0
import java.util.Scanner;public class Payroll{	public static void main(String[] args)	{		int hours;		int rate;		int tax;		int grosspay;		int netpay;		int fedtax;		Scanner keyBoard = new Scanner(System.in);		System.out.print("Enter hourly pay rate: ");		rate = keyBoard.nextInt();		System.out.print("Enter hours worked: ");		hours = keyBoard.nextInt();		System.out.println("You worked " + hours + "at $ + rate");		System.out.println("Gross pay: + grosspay");		grosspay = (hours * rate);		System.out.println("Withholding tax: $ + withholdingtax");		tax = .15;		withholdingtax = (grosspay * tax);		System.out.println("Net pay: + netpay");		netpay = (grosspay - withholdingtax);	}}
-1

New to Communities?

Join the community