Im really new to java and need help with class.
Here is what im trying to do
Write a class that accepts a user's hourly rate of pay and the number of hours worked.
Display the user's gross pay (gross pay = hours worked * hourly rate),
the tax withheld (tax withheld = gross pay * tax rate) and the net pay
(net pay = gross pay - tax withheld).Use a named constant for storing the tax rate of
0.15
Here is my Code:
import java.util.Scanner; class Tutorial { public static void main(String[] args); { Scanner kb = new Scanner(sysem.in); double = hourlyrate; double = hoursworked; double = grosspay; double = netpay; double = taxrate 0.15; double = taxwithheld; System.out.println("Please enter rate of pay?" ); hourlyrate = kb.nextdouble(); System.out.println("Hours Worked?" ); hoursworked = kb.nextdouble(); System.out.println("Gross pay:" )+(grosspay = hoursworked*hourlyrate); System.out.println("Tax Withheld:" )+(taxwithheld= grosspay*taxrate); System.out.println("netpay:" )+(netpay= Grosspay-taxwithheld); } }