Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: PLEASE HELP ME WITH THIS PROBLEM

  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PLEASE HELP ME WITH THIS PROBLEM

    Write a program that allows the user to do a payroll listing on any number of employees, up to a maximum of 20, for a one week period. This program must be written using arrays, classes and methods. The program is to be broken into various tasks; each task will be coded as a method. Each method will be passed arguments and will return a value.

    Several arrays will be used in the program; no array will exceed 20 elements. One array will hold the employee numbers that are input. Other arrays will hold the Computed Gross Pay, Computed Income Tax and Computed Net Pay values. When the user indicates he/she wishes to stop the input of employee data, the program will display a list of employee numbers, and the corresponding computed values, plus a total for each of the computed values.

    The following shows a sample run of the program with user inputs in boldface.

    >payroll


    Enter Employee Number : 123-45-6789
    Enter Regular Hours Worked : 40
    Enter Overtime Hours Worked : 0
    Enter Hourly Pay Rate : 15.00
    Enter Marital Status (M or S) : M
    Enter number of Exemptions taken (0-4) : 2
    Computed Gross Pay : P600.00
    Computed Income Tax :-P126.90

    ---------------
    Computed Net Pay : P473.10


    Do you wish to do another(Y/N)? Y

    Enter Employee Number : 234-56-7890
    Enter Regular Hours Worked : 40
    Enter Overtime Hours Worked : 0
    Enter Hourly Pay Rate : 20.00
    Enter Marital Status (M or S) : S
    Enter number of Exemptions taken (0-4) : 0
    Computed Gross Pay : P800.00
    Computed Income Tax :-P217.50
    ---------------
    Computed Net Pay : P582.50


    Do you wish to do another(Y/N)? N


    Employee Payroll Roster

    Employee Gross Deductions Net
    Number Pay Pay
    ---------- --------- --------- ----------
    123-45-6789 P 600.00 P 126.90 P 473.10
    234-56-7890 P 800.00 P 217.50 P 582.50
    --------- --------- ----------
    Totals P1400.00 P 344.40 P 1055.60

    Employee Number is declared as a variable and assigned a value by the user as each employee's data is processed. Character Data.

    Regular Hours Worked is declared as a variable and is input by the user as each employee's data is processed. Integer Data.

    Overtime Hours Worked is declared as a variable and is input by the user as each employee's data is processed. Integer Data.

    Hourly Pay Rate is declared as a variable and is input by the user as each employee's data is processed. Float Data.

    Marital Status is declared as a variable and is input by the user as each employee's data is processed. Only M or S may be input.

    ‘Exemptions’ is declared as a variable and is input by the user as each employee's data is processed. This is the number of tax exemptions the employee is taking. In this program, the only allowable value for exemptions is 0 thru 4. Integer Data.

    Weekly Gross Pay is a computed value derived from Regular Hours Worked multiplied by Hourly Pay Rate plus Overtime Hours Worked multiplied by the product of Hourly Pay Rate multiplied by 1.5.

    ‘Deductions’ is a computed value to indicate the amount of tax deductions needed to be subtracted from the Adjusted Gross Pay. Adjusted Gross Pay is computed by taking the number of Exemptions an employee has and multiplying that by P13.50. This amount is then subtracted from the Weekly Gross Pay amount to give Adjusted Gross Pay. Adjusted Gross Pay is then used to determine the amount of income tax owed. The following indicates how to calculate the income tax amounts based on the Adjusted Gross Pay.


    For Married Employees:
    Of Amount
    Adjusted Gross Pay Income Tax Over
    ------------------ ------------ ---------------
    P0.00 - P100 10% P 50.00
    P101 - P300 P 20.00 + 20% P 150.00
    P301 - P600 P 60.00 + 30% P 350.00
    P601 - P9999 P180.00 + 50% P 650.00


    For Single Employees:
    Of Amount
    Adjusted Gross Pay Income Tax Over
    ------------------ ------------ ---------------
    P0.00 - P100 10% P 50.00
    P101 - P300 P 20.00 + 10% P 150.00
    P301 - P600 P 60.00 + 15% P 350.00
    P601 - P9999 P180.00 + 25% P 650.00


    Weekly Net Pay a computed amount showing the take home or net pay for the employee. Weekly Net Pay is computed by subtracting Deductions from Weekly Gross Pay.
    When all employees’ payroll data has been processed, display the totals for gross pay, deductions and net pay.

    Each numeric value displayed on the screen should be formatted using output formatting code. After the user enters each value, rewrite it to the screen in proper format so that all entries will be aligned in columns.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    What have you tried?

    Be sure to wrap any posted code in code tags.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Oct 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    public class Payroll {
    public static void main(String[]args){
    System.out.println("Enter Employee Number :");

    System.out.println ("Enter Regular Hours Worked :");
    System.out.println ("Enter Overtime Hours Worked :");
    System.out.println ("Enter Hourly Pay Rate :");
    System.out.println ("Enter Marital Status (M or S) :");
    System.out.println ("Enter number of Exemptions taken (0-4) :");
    System.out.println ("Computed Gross Pay :");
    System.out.println ("Computed Income Tax :");
    System.out.println ("Computed Net Pay :");

    double grosspay, incometax, ans;



    i only try this. i don't know what to do. can you help me with this

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    Please edit your post and wrap your code with code tags:
    [code=java]
    YOUR CODE GOES HERE
    [/code]
    to get highlighting and preserve formatting.

    i don't know what to do
    Make a list of the steps the program must do to solve the problem.
    Start at the first step in the list:
    Figure out the logic needed
    write the code for that logic
    compile, execute and test the code
    if there are errors, fix them and repeat
    when there are not any more errors, move to the next step in the list.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Oct 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    can u please do this ? i am not a java lover. i really need a programmer to solve this

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    i really need a programmer to solve this
    Why not hire a programmer if you are not interested in learning java.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Oct 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    are you programmer

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: PLEASE HELP ME WITH THIS PROBLEM

    There are no programmers for hire here.

    Since you are not showing any effort to work on your problem:
    Thread closed
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Catch block problem. Please fix my problem.
    By damnitsme in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 3rd, 2014, 01:49 AM
  2. Problem with Project Euler problem 18
    By sara_magdy in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 19th, 2013, 12:46 PM
  3. Replies: 3
    Last Post: January 5th, 2012, 01:44 AM
  4. [SOLVED] [Problem] imports javax.swing problem
    By Brollie in forum AWT / Java Swing
    Replies: 8
    Last Post: July 5th, 2009, 07:59 AM
  5. Java program for 2-D Array Maze
    By Peetah05 in forum Collections and Generics
    Replies: 11
    Last Post: May 8th, 2009, 04:30 AM