Write function to calculate gross wages for hourly employee

Assignment Help JAVA Programming
Reference no: EM131396215

Assignemnt

1. In a separate JS file, write a function to calculate gross wages for an hourly employee. The function should receive two parameters: the pay rate (dollars per hour, a floating point number) and the hours worked. Hours from 0 through 40 are "straight time" pay, and any hours in excess of 40 are overtime pay at 1.5 times the standard rate (hint: use the ? : operator to make a decision about pay rates). The function should return a floating point number representing the gross pay amount. Note, the function should not do any output such as document.writeln or alerts.

2. In a separate JS file, write a function to compute the amount of taxes that should be withheld from a paycheck based on the gross pay. The function should receive one parameter, the gross pay. Withholdings are calculated based on the following table:

Category Percentage

Federal taxes 31%

State taxes 8%

Local taxes 2%

All local taxes are deductable from the gross amount used to calculate state taxes. Likewise all state and local taxes are deductable from the gross amount used to calculate federal taxes. The function should accept one parameter, the gross pay, and return one result, the total withholdings based on the above table and rules. Again, the function should not do any output, but should just return a number. Here is an example:

Input: 1000.00, return 377.90. Why not just 41% of 1000 = 410? 2% of $1000.00 is $20.00. Now subtract the $20.00 out of the gross, leaving $980.00 as the base for calculating state taxes. 8% of $980.00 is $78.40. Subtract $78.40 from the $980.00 to get $901.60, the base for calculating federal taxes. 31% of $901.60 is $279.50 (rounded to the nearest penny). When $20.00, $78.40, and $279.50 are added together, the result is $377.90, which is the answer that should be returned from the function. Note that these numbers are rounded to the nearest penny, which is possible with either the .toFixed() method of a number or by using Math.round().

Reference no: EM131396215

Questions Cloud

Criticize the given definitions - a house is a structure : Criticize the following definitions in light of the eight rules for lexical definitions:- A house is a structure made of wood or stone intended for human habitation.
Purchasing agent for a municipality : The purchasing agent for a municipality has contracted with a local car dealer to purchase four cars. The dealer has 25 cars on his lot; 10 red, 7 blue, 6 white, and 2 purple.
When an organization is preparing to outsource : When an organization is preparing to outsource and staff may/could lose their positions, what do you think is their biggest need from the organization?
Criticize the given definition - satire is a kind of glass : Criticize the following definitions in light of the eight rules for lexical definitions:- Satire is a kind of glass, wherein beholders do generally discover everybody's face but their own.
Write function to calculate gross wages for hourly employee : In a separate JS file, write a function to calculate gross wages for an hourly employee. The function should receive two parameters: the pay rate (dollars per hour, a floating point number) and the hours worked.
Purchase and the decision making process : Consider your last vehicle purchase and the decision making process you engaged in while deciding what vehicle to purchase or if a new vehicle was the right decision. While analyzing your decision, keep in mind that everything from the interest ra..
Criticize the given definitions - a carpenters square : Criticize the following definitions in light of the eight rules for lexical definitions:- A carpenter's square is a square used by a carpenter.
Fall in the price of televisions : Then, show how the wage changes in Canada due to a fall in the price of televisions, holding constant the price of timber. Can we predict that change in real wages?
Motivation - understanding self and others : Create a summary of the reading, also, develop two critical questions rising from the reading along with two ideas/concepts that you have found enlightening or thought to provoke.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Determine various currents and voltages

1. To troubleshoot a complex circuit and determine various currents and voltages using mesh analysis. 2. To simulate the complex circuit in MultiSim and record the required quantities.

  How to track password-cracking software

Imagine you are a digital forensic investigator for a healthcare organization. You learn from your internal information security department that an employee has been using password-cracking software to access confidential customer insurance inform..

  How do you arrange passenger on flight sits

Millions of commercial airline flights cross the world's cities every year, and each one of these flights must solve what seems like a simple problem: how do you arrange where each passenger on one of those flights sits

  Create a javafx application named runningman.java

Create a JavaFX application named RunningMan.java to animate a man running laps. The man should run from left to right until the edge of the window is reached. The man should then begin running in the opposite direction.

  Create a scatterplot visualization

Create a Scatterplot visualization that reads data from a comma-separated text file. The visualization code should be written in Java using Processing.

  Create an interface that includes a group box

Create an interface that includes a group box that contains 3 check box and 3 text box, the three text boxes should be invisible when the application starts

  Program to translates a number into the closest letter grade

Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade

  Construct java applications

Construct Java applications that demonstrate string manipulation, file input and output, and error handling. Create a Graphical User Interface application

  Powerful pain reliever are consumers with headaches

Your target market for the most powerful pain reliever are consumers with HEADACHES. Start with goals and objectives. Do a SWOT. What information is most important for your market? Do some market research.

  Conduct an internet search for javadb tutorial you might

please write a 200-400 word response to the following questionq1. conduct an internet search for javadb tutorial. you

  Design into java code

As a design activity- the class diagram from a set of classes which form the basis for a simple project management tool. Your design should have the following classes: Employee Class, Project Class, Consultant Class, Manager Class, theAssignment Clas..

  Compare the readability and writability of for loop in java

Search the internet about the properties of the for loop in Ada, compare the readability, writability and reliability of the for loop in Ada and Java. Explain your answer

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd