java programming *sarmad junaid - 28996

Request Posted by
yoshi3233

yoshi3233

Rating : No Rating
  • Requests:0
  • Solutions:0
Earned: $0
Request Detail
Price: $10
  • From: Computer Science, Programming
  • Due on: Sun 20 Oct, 2013 (11:47am)
  • Asked on: Sun 20 Oct, 2013
  • Due date has passed, but you can still Post Solution.
Description

1.    Write a class named Payroll that contains member variables to hold:

        Hourly pay rate
        Number of hours worked
       

2.    Write code that  displays the following values:

        Gross pay
        Witholding tax (15% of your gross pay)
        Net Pay (gross pay - witholding tax)

    
3.    Name the file Payroll.java 

Here is what i have so far:

public class Payroll {
//member variables to hold: Hourly pay rate Number of hours worked
double hourly_pay_rate;
int hours_worked;
//displays the Gross pay Witholding tax (15% of your gross pay)

void displayTax()
{
System.out.println("Witholding tax = "+(hourly_pay_rate*hours_worked*0.15));
}
//displays the Net Pay (gross pay - witholding tax)
void displayNetPay()
{
System.out.println("Net pay = "+((hourly_pay_rate*hours_worked)-(hourly_pay_rate*hours_worked*0.15)));
}
public static void main(String[] args) {
Payroll p = new Payroll();
p.hourly_pay_rate=10;
p.hours_worked=10;
p.displayTax();
p.displayNetPay();

}
}
}

*the program is basically done..just need to prompt it to input the hourly rate and hours worked

1 Solution for java programming *sarmad junaid
Title Price Category solution By purchased  
Java Programming Language Homework Help
$10.00 no category sarmad_junaid 1 time(s)
Please Login or Register to Submit the Solution for the Request