A Java program to do payroll calculation

Company weekly payroll. The input will be a list of hours worked by employees. The output will be the list of amounts owed to each employee plus a total sum of the amounts owed.

Use two methods that work with arrays that contain the payroll data. The first method, which will be called getPayrollData(), will be called from main() in order to get the payroll data from the user. It must do the following:

Don't use plagiarized sources. Get Your Custom Essay on
A Java program to do payroll calculation
From $10/Page
Order Essay

Prompt the user for the number of employees to be processed.
Create an array of the size needed to hold the hours worked for this many employees. This should be an array of int since the company requires that full hours be worked.

Input the hours worked into the array using a loop and identifying employees as described further down.

Pass the array back to main() as the return value of the method.
You will create a second method called processPayroll() that returns an array of doubles. It will take the hours worked array as a parameter and process it. This method must do the following:

Receive the array from main() as a parameter.

Create a new array of doubles to hold the wages information for each employee. This second wages array will have to be the same size as the hours worked array.

Process the data elements by calculating the wages owed to the employee for the number of hours worked and loading this data into the corresponding element of the wages array. The calculation of wages will be done at a fixed pay rate of $38.57/hour with time and a half for over time where over time is any number of hours worked in excess of 40 hours.
Return the wages array.

When processPayroll() returns to main() the code in main() will do two things:

Print out the list of employees identifying them by the array index as described below, how many hours were worked, and and how much is owed to each one.

Print out the sum total of money owed by the company for the payroll.
To make it simple to associate employees to array elements we will assume that the company identifies employees by a payroll number. This number conveniently begins with 100 for the first employee and counts up from there. So you can just add 100 to the array index for the particular employee to display the employee number. You must show the employee number during the input process by prompting for the hours worked by that employee number. You must also print the employee number when displaying the output list of amounts owed to each employee. This means that data for employee #100 is in array location 0, #101 in array location 1, etc.

The input/output format must duplicate the format shown in the sample run below. The user inputs are shown in blue text. You must use printf() to make the amounts in dollars print with two decimal places of accuracy.

Enter number of employees: 4
Enter below the hours worked for the employee number:
#100: 40
#101: 43
#102: 37
#103: 40

Payroll Report:

Emp Number Hours Wages($)
———- —– ———

100 40 1542.80
101 43 1716.37
102 37 1427.09
103 40 1542.80

Total wages: $6229.06

A template program is attached to help you get started and to get things structured the way they need to be.

Solution Preview
The focus of this solution is the processing of arrays. The first method, getPayrollData(), shows how to declare an array and read data into it.

public static int[] getPayrollData()
// Declare getPayrollData() local variables
int numEmployees;
Scanner in = new Scanner(System.in);
int[] payrollData;

// Prompt the user for the number of employees to be …

Solution Summary
This solution provides a complete Java program to do basic payroll calculation. It also includes a detailed explanation of how the program works.

To continue with the answer check on mycoursewriter.com/

Order NOW For A 35% Discount!
Pages (550 words)
Approximate price: -

Why Choose Us

Quality Homework Writing

Do you need to ace your test? We have qualified writers to assist you in writing 100% quality homework writing. Mycoursewriter offers students unique and personalized custom papers that help them in getting good grades. Our academic experts will assist you with your dissertation papers, thesis writing, research papers, term papers, and case study homework help. Our writers are experienced and have perfected the art of crafting the best essay writing papers regardless of your academic level. Order now and get our superb homework writing services.

Expert Academic Writers

A student needs professional assistance outside class time. Before hiring our writers, they undergo thorough tests and strict educational backgrounds. After passing a test, our writers undergo training to ensure they deliver expert professional papers to our customers. We ensure they meet the timely delivery of papers and follow our customers' provided instructions. Every writer is an ENL writer and is from the USA, Canada, UK, or Australia. Our experts approach papers effectively depending on their area of specialization.

Affordable Price Guarantees

Is the deal too good to be true? Mycoursewriter is the most affordable assignment help website on the market. We consider students' daily needs for academic help. Our paper costs are reasonably priced to approximately 90% of students around the globe. Our main aim is to ensure students achieve academic excellence, and we believe inconsiderable prices should not hinder students from getting quality homework writing help. In case of any dissatisfaction, we offer unlimited revisions and rewrites without extra charges.

Timely delivery of papers

Tight deadline? Is your paper due in the next few hours? Worry no more. Our writers are here for your rescue. Many college students find it hard to balance their social and academic life and get caught up with academic deadlines. Drafting your paper at the last minute does not allow you to conduct extensive research and craft the correct answers. We have expert writers ready to work on your assignment writing. Urgent writing services are the ultimate solutions you need. We guarantee you timely delivery of papers at your convenience and specified time delivery of the customer.

100% Original Tasks

The ultimate deal-breaker in achieving good grades is submitting imitative papers. Plagiarism is a breach of examination standards and has serious consequences. Students need to deliver papers written in their understanding by paraphrasing their research findings and relevant citations. Our expert's primary consideration is providing free plagiarized papers that meet the lecturers' requirements. Our editors will proofread your paper before delivery ad ensure your papers will not be substandard. We guarantee extreme originality, and in case of any customer concerns, we offer a plagiarism report.

All Round the clock Customer Support

Our website is user-friendly and super useful! Mycoursewriter is the most trusted online writing website always available to provide you with assignment writing services that you need. Our primary concern is meeting customer need specifications by our friendly customer support team that Is available all the time. Our website usability is self-learnable but in case of any problem, feel free to contact us directly through our website email: support@mycourserwiter.com. We have diligently satisfied thousands of students, and you can witness this on our sites' review page.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Advantages of Using Our Assignment writing Services

Mycoursewriter welcomes you for superb essay writing services. We are a legit site offering help with your most challenging homework writing assignments at affordable prices. Your essay paper will be assigned to a professional writer who will craft the paper from scratch according to your provided instructions.


Essay Writing and Proofreading Services

Essay writing is a common assignment writing for most college students. It takes a lot of time to craft a complete perfect essay. Mycourserwiter offers the best essay writing and proofreading services for most college students. Your paper is assigned to an expert writer who does thorough research on fresh ideas and personalizes your essay paper according to your assignment writing guidelines. Our essays are entirely exceptional and undergo a strict procedure that includes papers free from plagiarism and thorough proofreading.


Admission and Business Papers

Writing an admission paper is not every student's desire, and this should not hinder any student from earning an admission. Writing a perfect personal statement to earn a position in a dream school or job can be stressful. Personal statements should display a high level of confidence and uniqueness. Admission essays require you to have a vast knowledge of the current happenings in the world and knowhow of the business world. We have qualified writers with skills who will write your admission paper through comprehensive research. All you have to do is provide us with little details about yourself, instructions and our writers will craft a perfect paper for you.


Editing and Proofreading

Mycoursewriter offers you assignment writing services free from grammatical and formatting mistakes. An error-free paper is significant in scoring the desired maximum grades. We have a team of editors who will go through your paper after our expert writers have delivered their fully crafted papers. Our writers will cover all the aspects of your paper instructions, such as fonts, spacing, and educational formats. Our team of editors will check through your paper to make sure it meets the formatting style provided in the paper instructions. Under no circumstances will a poorly formatted paper will be forwarded to you as our team of editors will ensure careful proofreading.


Technical Papers

Assignment writing is part of a learning process, and one may not have the knowledge to answer all questions correctly. This should not be a stress to you as we have qualified essay writing experts to help you. Our qualified writers are holders of PhDs, Degrees, and Masters in different areas of study and can handle any papers regardless of the complexity. Multiple assignments may be challenging to finish on time. Our skilled professional writers are here to assist you in crafting all the correct answers for your assignment. Stop stressing about your homework writing and place an order with us, and our expert writers will provide you with the best assignment help.