Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Payroll Program, Working with Array and Classes

This third programming project is intended to demonstrate your knowledge of the following: 

create and implement a simple class 
properly use static variables, methods and constants 
use arrays to efficiently organize data 
use the this keyword (not required here; may be incorporated appropriately for bonus points; often used in searching a database)
The third programming project involves reading in payroll data for a series of employees and computing the gross pay for each employee for the week. The program should consist of two classes. The first class EmployeePayroll represents payroll data for one employee for one week. It should contain the following data:

class constants for the weekend multiplier factors 
a class variable that maintains the number of employee objects created 
an instance double precision floating point variable containing the employee's hourly pay rate 
an instance integer array of hours worked for each day of the week for one employee 
This class should contain the following methods:

a constructor that is supplied a string that contains one line of employee payroll data--the pay rate followed by the hours worked for seven days 
an instance method called computeGrossPay that returns the gross pay for that employee 
a toString method that returns a string representation of the object 
a class method employeeCount that returns the total number of employees 
Saturday hours are paid at time and a half and Sunday hours at double time.

The second class should contain the main method. It should repeatedly prompt the user for payroll data, which should be entered on a single line for each employee. It should create an employee object using the constructor, display the object with toString and display the gross pay for that employee.

After all employees have been processed, the employeeCount method should be called to display the total number of employees. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9107503

Have any Question?


Related Questions in Computer Engineering

How to design a java program that reads a sentence say s

How to design a Java program that reads a sentence, say s, consisting of lower-case words with .nextLine() method, identifies the words using .indexOf() and .substring() methods and saves them in String variables. Then t ...

The demand for salt is relatively price inelastic while the

The demand for salt is relatively price inelastic, while the demand for pretzels is relatively price elastic. How can you best explain why and elaborate your answer.

Requirementsdesign and implement an application with a

Requirements Design and implement an application with a graphical user interface to manage a library of songs. A song is uniquely identified by name and artist (case insensitive). Your application should have a SINGLE WI ...

A sample of 1000 us households is taken and the average

A sample of 1,000 U.S. households is taken and the average amount of newspaper garbage or recycling is found to be 27.8 pounds with a standard deviation of 2 pounds. Estimate, with 90% confidence, the mean amount of news ...

Question 1 where to be careful when using cloud services2

Question: 1. Where to be careful when using cloud services? 2. What are those cloud essential characteristics in "The U.S. NIST Definition of Cloud Computing"? The response must be typed, single spaced, must be in times ...

Imagine an election with just two candidates candidate a

Imagine an election with just two candidates. Candidate A asks her consultant to conduct a poll to see if she (Candidate A) is leading. What is the "null hypothesis" value that is being "tested" in this example?  Your an ...

Shellys preferences for consumption and leisure can be

Shelly's preferences for consumption and leisure can be expressed as U(C, L) = (C - 100) (L - 40). This utility function implies that Shelly's marginal utility of leisure is C - 100 and her marginal utility of consumptio ...

What are the minimum numbers of keys and pointers in btree

What are the minimum numbers of keys and pointers in Btree (i) interior nodes and (ii) leaves, when: a) n = 10; i.e., a block holds 10 keys and 11 pointeis. b) n = 11; i.e., a block holds 11 keys and 12 pointers.

Penetration testing is a technique used to identify

Penetration testing is a technique used to identify security weaknesses in your network. Discuss a type of penetration testing and the different methods utilized to recognize vulnerabilities in your network.

Q1 state whether the following is true or false and why1

Q1. State whether the following is true or false and why: (1) Monopolists can charge whatever price they want and maximize profit since they are price makers.  T/F: Why? (2) A firm that has a monopoly on a certain good m ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As