Post a New Question

Oop programming

posted by .

Write a program that inputs (from the user) the number of hours worked and hourly pay rate for employees and outputs their total pay. The program should process an arbitrary number of employees; the user will terminate input by entering 0 for hours worked and rate of pay. Use a class called Worker as follows:

Attributes: Hours, Rate, Total

Methods: ComputeTotal and access methods for each of the attributes

  • Java? -

    Start with a template and fill in the information as stipulated by the requirements. I do not see requirements for storing the data, so each instance of Worker will just request input, print the calculated results, and quit.

    public class Worker{
    // state variables: (define attributes)
    ...
    // constructor (from hours, rate)
    ...
    // Methods
    // accessors for each attribute
    ...
    // compute method, returns total
    ...

    public static void main(String[] args){
    // A while loop to request input,
    // create an instance of Worker
    // output data and total
    // terminate while-loop when hours and rate are 0
    ...
    }

    }

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. programing

    A small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employee’s name, the number of hours …
  2. programing

    small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employee’s name, the number of hours …
  3. devry

    A small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employee’s name, the number of hours …
  4. computer Programming

    A small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employee’s name, the number of hours …
  5. computer programming

    small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employee’s name, the number of hours …
  6. Programming

    Write a program that inputs (from the user) the number of hours worked and hourly rate for employees and outputs the total pay. The program should process an arbitrary number of employees; the user will terminate input by entering …
  7. OOP PROGRAMMING

    Write a program the inputs (from the user) the number of hours worked and hourly pay rate for employees and outputs their total pay. The program should process an arbitrary number of employees; the user will terminate input by entering …
  8. Programming in c++

    Write a program in c++ that inputs a number [1-12] from the user and displays the month. it also asks the user whether he wants to input another number or not, if the user inputs 1 then it again inputs number, if user inputs 0 then …
  9. Programming

    Write a program that inputs (from the user) the number of hours worked and hourly rate for employees and outputs the total pay. The program should process an arbitrary number of employees; the user will terminate input by entering …
  10. Programming

    Develop a Java application that will determine the gross pay for each of three employees. The company pays “straight line” for the first 40 hours worked by each employee and pays “time and a half” for all hours worked in excess …

More Similar Questions

Post a New Question